Combining Formulas (1 Viewer)

jeran042

Registered User.
Local time
Today, 09:12
Joined
Jun 26, 2017
Messages
127
I have 2 formulas that I need to combine for a report that I am creating, the first one pull the name of the previous month:

Code:
=Format$(DateAdd("m",-1,Now()),"mmmm")

The second one is a dlookup, Where I am trying to pull a value from the previous month.
Code:
DLookUp("Format$(DateAdd("m",-1,Now()),"mmmm")","qrySalaries","COST_CENTER= 3200")

Unsure if I am going about this the wrong way. I do not wish to have the query be the data source for this report.

Any guidance how to proceed, or where I can find some additional information would be greatly appreciated,
 

jeran042

Registered User.
Local time
Today, 09:12
Joined
Jun 26, 2017
Messages
127
I was able to figure this out, and, for anyone who faces the same problem, this is the answer,
Code:
DLookUp(Format(DateAdd("m",-2,Date()),"mmmm"),"qrySalaries","COST_CENTER=3200")
 

plog

Banishment Pending
Local time
Today, 11:12
Joined
May 11, 2011
Messages
11,638
I think you might be going about this the wrong way. You have columns named after months? If so, that is incorrect. Instead, you should have the month name be a value in the column.
 

Users who are viewing this thread

Top Bottom