Creating dynamic date criteria for a Date/Time field

Posted on 2013-09-25
Medium Priority
Last Modified: 2013-09-25
I want to hard code the following where clause dynamically for yesterday's date:

where format([ServiceDateTime],"yyyymmdd")='20130920'


Question by:GPSPOW
LVL 25

Accepted Solution

chaau earned 2000 total points
ID: 39523485
This is the criteria for yesterday's date:
where format([ServiceDateTime],"yyyymmdd")=format(DateAdd("d", -1, Date()), "yyyymmdd")

Open in new window


Author Closing Comment

ID: 39523510


Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When we develop an application in Ms Access 2016 we should also try to protect the queries, macros and table links. I know I may not have a permanent solution but for novice users, they will not manage to break your application. Below is the detail …
A Case Study of using the Windows API to provide RS232 communications capability in Access without the use of Active-X controls.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question