Results 1 to 2 of 2

Thread: Access: Query Date Criteria

  1. #1
    Board Regular gheyman's Avatar
    Join Date
    Nov 2005
    Orlando, FL USA
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)

    Default Access: Query Date Criteria

    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
    G Heyman
    Northrop Grumman - Laser Systems'
    Apopka, FL

  2. #2
    MrExcel MVP
    xenou's Avatar
    Join Date
    Mar 2007
    Clev. OH, USA
    Post Thanks / Like
    10 Post(s)
    1 Thread(s)

    Default Re: Access: Query Date Criteria

    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 by xenou; Apr 18th, 2019 at 08:48 AM.

    Using: Office 2010/Win7 (work) Office 2010/Win7 (home)

    You are rich in proportion to the number of things you can let alone.
    -- Henry David Thoreau

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts