Hey everyone,
I have a query that I am using to try to get the running total of a person's sales over a year for multiple years. The query has four fields: SALES_PERSON_ID (AUTONUMBER), EMPL_LAST_NAME, TOTAL_SALES, PERIOD_ENDING_DATE. I have added the last field as the running total with the code:
RunTot: DSum("[TOTAL_SALES]", "[TOTAL SALES]", "Format([PERIOD_ENDING_DATE], 'yyyymm') = '" & Format([PERIOD_ENDING_DATE], 'yyyymm') & "' AND [PERIOD_ENDING_DATE]-1 < #" & [PERIOD_ENDING_DATE] & "#")
It comes up with a total but it is completely wrong. For example, the first person's sales are $587,445.15 but the RunTot is $5,548,437.27. Can someone help please cause I have no idea why it is doing this?:banghead:
I have a query that I am using to try to get the running total of a person's sales over a year for multiple years. The query has four fields: SALES_PERSON_ID (AUTONUMBER), EMPL_LAST_NAME, TOTAL_SALES, PERIOD_ENDING_DATE. I have added the last field as the running total with the code:
RunTot: DSum("[TOTAL_SALES]", "[TOTAL SALES]", "Format([PERIOD_ENDING_DATE], 'yyyymm') = '" & Format([PERIOD_ENDING_DATE], 'yyyymm') & "' AND [PERIOD_ENDING_DATE]-1 < #" & [PERIOD_ENDING_DATE] & "#")
It comes up with a total but it is completely wrong. For example, the first person's sales are $587,445.15 but the RunTot is $5,548,437.27. Can someone help please cause I have no idea why it is doing this?:banghead: