Lookup value based on nearest date

  • Thread starter Thread starter Carol Chisholm
  • Start date Start date
C

Carol Chisholm

I have a table of rates which occur on certain dates (one a month).
It has two fields Rates.Date and Rates.Value

I then another table where each record has a date in it, and I need to
find the Value from Rates at the matching date, OR at the nearest date
if there is not an exact match.
It is possible that the date I need to lookup is before or after the
range of dates in my Rates table.

Is there a nice elegant way of doing this?
 
Carol

I believe both of those fieldnames ("Date" and "Value") are reserved words
in Access. I'm certain about the first and confident about the second.
Since Access reserves the use of these words for one meaning, when you name
a field Rates.Date, Access decides on its own whether to use your definition
or its own. Change the names of these fields.

If you use a query, you could use the "less than" or "greater than" symbols
("<" or ">") to compare your date values.

Regards

Jeff Boyce
Microsoft Office/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