Dsum assistance (1 Viewer)

fedebrin

Registered User.
Local time
Yesterday, 17:30
Joined
Sep 20, 2017
Messages
59
Hello,

Looking for a Macro that looks up and sums the TTM (12 trailing months) of OPEX from a different table.

In the table Initiatives I need a macro that will look up and add the 12 trailing months of OPEX from the OPEX table based on the date that it is entered.

Also, if a future date is added, that the macro will select the first available month in the OPEX table to start the 12 month sum.

OPEX.JPG


Initiatives.JPG
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:30
Joined
Oct 29, 2018
Messages
14,140
Hi. Can you show us what you have tried so far?
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:30
Joined
Feb 19, 2002
Messages
31,100
You would do this with a query. If the query always is for the current day back 12 months, the criteria can be calculated by the query. If you want to have some control over the range, use a form with either a start and and end date or just an end date and the start date can be calculated by the query. The criteria will be:

Where TranDate Between Forms!yourform!txtStartDT and Forms!yourform!txtEndDT
 

Users who are viewing this thread

Top Bottom