DSum with dynamic date criteria

jibb

Registered User.
Local time
Today, 15:20
Joined
Dec 1, 2011
Messages
93
I need to do a DSum with criteria that picks up a previous month based on todays date, I have got the following but I don't know how to format the last part of the criteria. If I take out the Month(DateAdd("m",-13,(Date()))) and replace it with 6 it works fine.

Code:
 DSum("[invquan]","[qrySalesByStockCode]","[stcode] = '" & [stockcode] & "' and [Month] =  Month(DateAdd("m",-13,(Date())))'")

Any ideas please...?:confused:
 

Users who are viewing this thread

Back
Top Bottom