autolookup query w/ date range

M

misssoysauce

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.
 
M

Michel Walsh

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
 
Top