Tuesday, November 2, 2010

how to select records of particular date from a sql table if time is also there?

query for select all records.
select * from tbltable


query for select record for particular date
select * from tblTable where dDate='10/29/2010'
but because of time there is no record retrieved in result
now if you want to record from a particular date not including time use this query
select *  from tbltable 
where DateAdd(day, datediff(day,0, dDate), 0)=DateAdd(day, datediff(day,0, '10-29-2010'), 0)

No comments:

Post a Comment