Hi
I have Black_List table in database
behcode
|
AttenDate
|
name
|
Id
|
1111
|
2013-02-26
|
sara
|
1
|
2222
|
2013-03-12
|
jack
|
2
|
in AttenDate it save date
In Blacklist page I have 3 TextBox
1-txtDay
2-txtMonth
3-txtYear
now I want when users enter number in txtday it update this number in AttenDate column in day of date and it update txtMonth value in Month of AttenDate column and for year do it too
so I create below SP
ALTER procedure [dbo].[Edit_BlackList]
@id int
,@name nvarchar(25)
,@behcode nvarchar(10)
,@Day int
,@Month int
,@Year int
as
begin
update Black_list
set
name=@name
,DATEPART(Year,[AttenDate])= @Year
,DATEPART(Month,[AttenDate])= @Month
,DATEPART(DAY,[AttenDate]) = @Day
where id=@id or BehCode=@Behcode
end
but when I run SP below error happen
Msg 102, Level 15, State 1, Procedure Edit_BlackList, Line 22
Incorrect syntax near ','.
is my SP right?
Best Regards
Neda