SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Filter records on date
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

spareus
Yak Posting Veteran

India
52 Posts

Posted - 06/12/2013 :  10:13:04  Show Profile  Reply with Quote
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

India
52249 Posts

Posted - 06/12/2013 :  10:16:29  Show Profile  Reply with Quote

SELECT *
FROM table
WHERE [done date] > = '20130604'
AND [done date] < '20130605'


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

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 06/12/2013 :  10:17:32  Show Profile  Reply with Quote
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

India
52 Posts

Posted - 06/12/2013 :  10:20:27  Show Profile  Reply with Quote
Great Visakh.
I was fumbling with date formates.
Thanks.


Regards,
Spareus
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 06/12/2013 :  10:39:26  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000