I have 10 rows for today's date but my select statement based on date dosen't seem to work....
SELECT Id,WirelessId,RegNo,DriverName1,MobileNo1,DriverName2,MobileNo1 from
DailySchedule where IsDeleted=0 and CreatedDate='2010-05-28'
Any suggestion...
Only if the dates assigned to them are midnight today. It might be better to do:
CreatedDate BETWEEN '2010-05-28 00:00' AND '2010-05-29 00:00'
If you want all the entries for May 28th I would do
and CreatedDate >='20100528'
and CreatedDate < '20100529'
Notice the safe ISO format (YYYYMMDD) no dashes
Also take a look at How Does Between Work With Dates In SQL Server? to see why between can not give you all the results you want
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With