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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Filter records on date

Author  Topic 

spareus
Yak Posting Veteran

52 Posts

Posted - 2013-06-12 : 10:13:04
I have a field name as [done date] which is having data type as datetime like 2013-06-04 16:56:11.250

I want to filter on date with 2013-06-04.

Pl help.

Regards,


Regards,
Spareus

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-12 : 10:16:29
[code]
SELECT *
FROM table
WHERE [done date] > = '20130604'
AND [done date] < '20130605'
[/code]

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-12 : 10:17:32
also see

http://visakhm.blogspot.in/2012/12/different-ways-to-implement-date-range.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

spareus
Yak Posting Veteran

52 Posts

Posted - 2013-06-12 : 10:20:27
Great Visakh.
I was fumbling with date formates.
Thanks.


Regards,
Spareus
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-12 : 10:39:26
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -