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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Sorry, an Access question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Steve2106
Posting Yak Master

United Kingdom
170 Posts

Posted - 10/18/2013 :  10:07:09  Show Profile  Reply with Quote
Please forgive my post here but I have asked on some Access forums and no one replies.
I have always got at least a reply from this forum so thought I would ask here.
I am using an MS Sql Server database for my backend.
In the Access query designer I need to add a criteria on a DateTime field that says if today's date = that of entry date, display the record.
In my field "EntryDate" I have the value "18/10/2013 07:47:26"
What should I enter in the criteria field because if I enter Date(), it does not work.

Thanks for your help.

All the best,



Steve

Edited by - Steve2106 on 10/18/2013 10:08:17

TG
Flowing Fount of Yak Knowledge

USA
6062 Posts

Posted - 10/18/2013 :  10:31:20  Show Profile  Reply with Quote
Let's take Access out of the equation because your backend is sql server. Sounds like your data contains datetime values and you need to query for a range of datetimes covering a 24 hour period (today 12:00:00 AM through today 11:59:59 PM)

not sure how to generate this code using access but for sql:
where [EntryDate] >= dateadd(day, datediff(day, 0, getdate()), 0) --today 12:00 AM
and [EntryDate] < dateadd(day, datediff(day, 0, getdate()), 1) --tomorrow 12:00 AM

Be One with the Optimizer
TG
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.03 seconds. Powered By: Snitz Forums 2000