DLookup Function

G

Guest

In one table I have a transaction date, in a second table I have the closing
dates for the accounting periods. In the same table as the closing dates I
have the fiscal month and fiscal year that represent the closing date. In a
query I would like to pull in the fiscal month and fiscal year based on teh
transaction date.
 
G

Guest

So I want to look up the first period that has a closing date greater than
the transaction date.
 
G

Guest

Here is my current formula.

DLookUp("[Fiscal
Month]","ACCTG_PERIODS","[dbo_SOP10200]![ReqShipDate]<=[ACCTG_PERIODS]![Closing Date]")

Fiscal Month = field name withing the ACCTG_PERIODS table
[dbo_SOP10200]![ReqShipDate] = table and field name of the transaction date
[ACCTG_PERIODS]![Closing Date] = table and field name of the closing date
 
G

Guest

=DMin("[FiscalMonth]", "SecondTable", "[ClosingDate] > #" & TransActionDate &
"#"

I think the DMin function will work better for this. Since I don't know
where you will have the Transaction Date, I dummied it up for the example.
Just replace it with the reference to where you have the Transaction Date.
 

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