DLookup Function

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
So I want to look up the first period that has a closing date greater than
the transaction date.
 
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
 
=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.
 
Back
Top