rskshiva
01-11-2005, 05:22 AM
Hai,
I need to select/update/delete the records for the date given by the user.
The user gives the date as 1/5/2005 (mm/dd/yyyy format).
As the field is datetime the vales is as like "1/1/2005 6:59:37 PM".
When I wrote a query like " select *from test where testdate='1/5/2005' " it doesn't took any records.
I had tried
CAST(CONVERT(Varchar, SentDateTime, 101) AS DateTime) = '" & strDate & "'"
It is returnig the correct rows.
But it will make problems after indexing.
Is there any better way to to this?
Suggestions are most welcome.
Regards,
Siva R
I need to select/update/delete the records for the date given by the user.
The user gives the date as 1/5/2005 (mm/dd/yyyy format).
As the field is datetime the vales is as like "1/1/2005 6:59:37 PM".
When I wrote a query like " select *from test where testdate='1/5/2005' " it doesn't took any records.
I had tried
CAST(CONVERT(Varchar, SentDateTime, 101) AS DateTime) = '" & strDate & "'"
It is returnig the correct rows.
But it will make problems after indexing.
Is there any better way to to this?
Suggestions are most welcome.
Regards,
Siva R