Retrieve data with date parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to select data in a query that fall between two dates. Can anyone
pls help me with a formula.

Many thanks in advance!
 
I am trying to select data in a query that fall between two dates. Can anyone
pls help me with a formula.

Many thanks in advance!

SELECT * FROM MYTable WHERE MyDateFIELD BETWEEN
#StartDate# AND #endDate#

Start and EndDate have to be mm/dd/yyyy format
 
Sarah

Open a query in design mode. Add the field that holds the date.

As a criterion under that (date-related) field, use something like:

Between #1/1/2004# And #1/31/2004#

The "#" signs are NOT optional if you are using actual dates (but Access
will insert them if you only type the dates).

Check the wide variety of date-related functions to try other values.

Use parameters if you want the user to enter dates.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top