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
 SQL Query Using Access

Author  Topic 

nudad98
Starting Member

1 Post

Posted - 2010-02-25 : 15:53:24
Very new with this so please bear with me. I am trying to build a query in Access that pulls from a SQL table. I am working with a datetime field and just trying to query data each day that shows the previous days activity.

I have set the field in the access query builder to short date and added the criteria DATE()-1 but nothing returns when I run it. When I remove the criteria I see all activity for every day. Do you know why it doesn't work with the DATE()-1? Actually I haven't been able to query any specific dates from the Table using Access tools. It seems like the Access date format isn't playing well with the Sql datetime field.

I have been researching and messing with this for quite a while now but haven't had any success with it. Is there something simple I am missing here? I appreciate any info you can offer.

Thanks!!

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2010-02-26 : 03:07:07
use Now()-1 or Format(now(),'yyyy-mm-dd') (not sure if thats 100% correct as not worked with Access for a while, but you should get my drift..
Go to Top of Page
   

- Advertisement -