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

Posted on 2007-07-29
Medium Priority
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

peter57r earned 1000 total points
ID: 19587812
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

ID: 19587866

in your report add a textbox

put this as controlsource:

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

Author Comment

ID: 19587931
Thank you very much.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

621 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