Date falls between StartDate and EndDate?

B

Bob

Hi there,

How can I return records where a date falls between the StartDate and
EndDate of a table.

Group : StartDate : EndDate
A : 01/01/01 : 31/01/01
B : 10/01/01 : 20/01/01
C : 20/01/01 : 25/01/01

i.e: A date of 18/01/01 would return Group A and B, but not C as 18/01/01
does not fall between the StartDate and EndDate of that record.

Thanks
 
B

Bruce M. Thompson

How can I return records where a date falls between the StartDate and
EndDate of a table.

Group : StartDate : EndDate
A : 01/01/01 : 31/01/01
B : 10/01/01 : 20/01/01
C : 20/01/01 : 25/01/01

i.e: A date of 18/01/01 would return Group A and B, but not C as 18/01/01
does not fall between the StartDate and EndDate of that record.

Enter the following criteria for your fields:

StartDate: <=[Enter Date as 'M/D/YYYY']
EndDate: >=[Enter Date as 'M/D/YYYY']

The reference to "[Enter Date as 'M/D/YYYY']" can be just as entered, or it can
be a reference to a textbox on a form or any other reference that can represent
a date. It must, however, appear exactly the same everywhere that criteria is to
be inserted if used as above or you will be prompted multiple times.
 
B

Bob

Thank you.

I managed to get to the answer also, using a query on a query, but your way
is better.

Bruce M. Thompson said:
How can I return records where a date falls between the StartDate and
EndDate of a table.

Group : StartDate : EndDate
A : 01/01/01 : 31/01/01
B : 10/01/01 : 20/01/01
C : 20/01/01 : 25/01/01

i.e: A date of 18/01/01 would return Group A and B, but not C as 18/01/01
does not fall between the StartDate and EndDate of that record.

Enter the following criteria for your fields:

StartDate: <=[Enter Date as 'M/D/YYYY']
EndDate: >=[Enter Date as 'M/D/YYYY']

The reference to "[Enter Date as 'M/D/YYYY']" can be just as entered, or it can
be a reference to a textbox on a form or any other reference that can represent
a date. It must, however, appear exactly the same everywhere that criteria is to
be inserted if used as above or you will be prompted multiple times.
 

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