Function to check if current date is equal to any date between two dates.

Posted on 2007-07-29
Last Modified: 2012-08-30
I'm looking for the function that will pull the records for personnel that are on vacation during the date the report is run.  Using fields:  StartVacDate and EndVacDate.

Your help is greatly appreciated
Question by:zubin6220
    LVL 77

    Accepted Solution

    I have taken your Q to mean that the start and end dates are on each record and you want a list of records where 'today's date' falls between the two.

    Select * from mytable where date() between Startvacdate and endvacdate
    LVL 19

    Expert Comment


    in your report add a textbox

    put this as controlsource:

    =IIf(([startvacdate]<=Now()) And ([endvacdate]>=Now());"on vacation";"-")

    Author Comment

    Thank you very much.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now