Access: Query Date Criteria

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,720
On the reference form I have a date that this formula, which is in a query criteria, calculates off of. (It works fine)

>=CDate([Forms]![frmCostHistory]![TextQuoteExpDate01]) But what I really need is a "Between date" formula.

I want to show records where the date is Between the date on the form (including that that) and is less than today.

Help please, I am struggling with this
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

xenou

MrExcel MVP, Moderator
Joined
Mar 2, 2007
Messages
16,628
Office Version
2013
Platform
Windows
You should be able to AND the criterion for less than today:

( >=CDate([Forms]![frmCostHistory]![TextQuoteExpDate01]) AND < Date() )

to be less then or equal to todays date instead of just less than todays date I think this works in vba (since less than Date() + 1 includes all the dates and times up to 11:59:59 PM, although if you know you are working with pure dates without times, then you can use equality on the date with the same result):

( >=CDate([Forms]![frmCostHistory]![TextQuoteExpDate01]) AND < (Date() + 1) )

The second formula is just for reference, or a note for future use. The first formula should fit your requirement.
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,095,711
Messages
5,446,097
Members
405,379
Latest member
EDGOUG

This Week's Hot Topics

Top