Sorry, this is question for beginners.
I'm using MS Visual Studio and MS SQL Server.
I have the table 'RoutineActivities' and its field 'StartDate' whose DataType is Datetime.
A tipical instantiation of this field would be '15/02/2004 10.32.53'.
Now, in a query, I'm passing the parameter '@dotnet.itags.org.Date' with value '15/02/2004'.
I would like to select records from 'RoutineActivities' Where StartDate=@dotnet.itags.org.Date.
Obvioulsy no records are returned with this syntax.
I'm not able to find a way to compare my '@dotnet.itags.org.Date' parameter with the Date part ONLY of the 'StartDate' field.
Can anyone help me?
Thanks
GinoFormat your date to a string like "20040223"
Then convert your datetime field the same way...
convert(varchar (8), startdate, 112) = @.Date
Thank you
Gino
0 comments:
Post a Comment