Access: Query Date Criteria

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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