Question : Get records based on current date

I need to get all records where "Created" = current date. If you see attached code I have made a SQL that almost works, but this get all records from now and one day back in time. I dont want to get records from yesterday!

How can this be done so only records from today (GETDATE()) is returned?



Code Snippet:
1:
SELECT Id FROM tblUserStatement WHERE Created BETWEEN getdate()-1 and getdate()

Answer : Get records based on current date

try this
1:
2:
3:
SELECT Id 
FROM tblUserStatement 
WHERE convert(varchar, Created, 101) = CONVERT(varchar, getdate(), 101)
Random Solutions  
 
programming4us programming4us