autolookup query w/ date range

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

Guest

I want to create a table or query where, based on the calendar month, a set
fuel price will be called up.

I created the table with the monthly prices as just one entry per
month--which defaults to the 1st of the month.

When I run the autolookup query, the fuel prices are generated, but *only*
for entries which are dated to the 1st of each month.

Question: how do I make the query encompass the range of dates within a
calendar month? This system would work in excel. I don't want to add date
fields for the entire year if there is a way around it.

Cheers.
 
Hi,


It is not clear what your data really is. If there is a date_time field,
then Month(thatField) ( and Year(thatField) ) can be used to get the
month number (and the year). Another possibility is:

dateTimeField - Day( dateTimeField) + 1

and this computed expression evaluate to the first of the month, whatever
the date in the month is supplied in the field.



Hoping it may help,
Vanderghast, Access MVP
 

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