finding which date range a date is in?

Q

Quintus Snapper

Hi All,

I am trying to make a small db which holds car rental data. Prices for
the cars differ based on the season. There are 3 seasons (low, med &
high).

I have made a table which contains the season date ranges, like:

Season - StartDate - End Date (DD/MM/YY)
Low - 01/11/04 - 19/03/05
Med - 20/03/04 - 30/06/04
Med - 01/10/04 - 31/10/04
High - 01/07/04 - 30/09/04

Now if I have a date, ie 14/06/04, how do I write a query to tell me
which Season it falls under?

Thanks in advance for any help.

Quintus
 
G

Guest

Create a query with your main data. Add the table for the seasons but do not link to the other table. In your fields, bring down the beginning and ending dates and the Season from the seasons table. In the criteria field of the beg date put >=[OrigDate] and for end date put <=[OrigDate].

Hope this helps.
 

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