Lookup function in Access

R

roseberryv

Is there a way in Access to duplicate the functionality of Excel's
lookup function? Our company has fiscal months that don't necessarily
match the calendar months. I'd like to create a table listing the
fiscal month number, beginning date, and ending date. I would then use
this table to tell me what fiscal month a specific date falls in. For
instance, if fiscal month #1 includes December 27th through January
25th, then for December 31st I would want the value of 1 returned for
the month number. I can do this in Excel, using the lookup function.
I suppose in Access I could loop through the months table and get the
answer through VBA, but it just seems that there must be some simpler
way to do this.
 
A

Arvin Meyer [MVP]

Is there a way in Access to duplicate the functionality of Excel's
lookup function? Our company has fiscal months that don't necessarily
match the calendar months. I'd like to create a table listing the
fiscal month number, beginning date, and ending date. I would then use
this table to tell me what fiscal month a specific date falls in. For
instance, if fiscal month #1 includes December 27th through January
25th, then for December 31st I would want the value of 1 returned for
the month number. I can do this in Excel, using the lookup function.
I suppose in Access I could loop through the months table and get the
answer through VBA, but it just seems that there must be some simpler
way to do this.
 
A

Arvin Meyer [MVP]

Looks like I pushed send on the other one.

In Access, you can use DLookup to find a value. This is similar to Excel's
function. You can also build a recordset, based upon your FiscalMonth table
and get values that way. That is much faster.
 
R

roseberryv

My problem is that I won't have an exact match, which I believe is what
the DLookup function finds. If I'm looking for what fiscal month
December 31st falls in, I need Access to return the value 1 if fiscal
month one is defined as having a beginning date of December 27th and an
ending date of January 25th, for example.
 

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

Similar Threads

Fiscal YTD Filter 7
Lookups in Access 3
cannot delete from specified tables 7
Group by fiscal months 5
Date lookup in Table 2
Fiscal Month Formula 3
dynamic table 3
Dmin and Dmax With Criteria 3

Top