Access: Query Date Criteria

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,332
Office Version
  1. 365
Platform
  1. Windows
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
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
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:
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,947
Members
448,534
Latest member
benefuexx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top