Start & End Date Columns - Need to extract anything that is Date()

G

Guest

Hi

I have two columns in my table (start date and end date).

Basically I want to extract any records for the current date and the next
days date (i.e. Date=() and Date=() + 1) .

For example,

Start Date Feild= 26/01/1998
End Date Feild= 10/08/2008

Current Date = Date()

Then my query would select the above record because record falls in between
Start Date and End Date.

Thanks,
GLT
 
J

Jeff Boyce

If I recall correctly, you need to use US date formatting to find date
criteria in a query. I assume this would mean

#1/26/1998#
#8/10/2008#

in your example.

You would use these values in your query's criteria under the two date
fields you mentioned.

I'm not sure I understand how Date() and Date() + 1 comes into the
picture...
 
G

Guest

Hi Jeff,

I only want any records between those two dates IF they fall on the current
date (i.e. Today's date) or tomorrows date. To work out the current date and
tomorrows date i beleive i need to use the Date() fucntion.

Cheers,
GLT
 
G

Guest

I actually just worked it out:

([Start Date]<=Date()) And ([End Date]>=Date())

I put the above statement in the criteria box on the Start Date feild and it
extracted what i wanted.
 
A

Allen Browne

To select only records where today's date is between fields Start Date and
End Date:

1. Create a query into this table.

2. In the Field row, enter:
Date()

3. Uncheck the Show check box under this field.

4. In the Criteria row, enter:
Between [Start Date] And [End Date]

If you do live in a country that does not use mm/dd/yyyy date formats, Jeff
Boyce's comments are important for you. More info in this article:
http://members.iinet.net.au/~allenbrowne/ser-36.html
 

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

Top