Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
hello friends I want to search the my_date between mydate_fr and mydate_tobut i am getting my_date from front end is like '9/12/2006' (mm/dd/yyyy)....but when i query this i am getting none records but if i manually type my_date like '09/12/2006' then i am getting records..how should i proceed..my query isSELECT *FROM my_DownLoadfilesWHERE '9/12/2006' >= my_date and my_date <= '9/12/2006'T.I.A
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts
Posted - 2006-09-22 : 05:01:20
use CONVERT function:
SELECT *FROM my_DownLoadfilesWHERE my_date between convert(datetime, mydate_fr, 101) and convert(datetime, mydate_to, 101)