Hello everyone,
I am having a problem creating a query that uses the monthly volume number and finds the corresponding volume for the same month of the previous year.
I am trying to use the DLookup function, but it only shows the first record it finds. To clarify:
Table: Monthly_Volume
Fields: Date(mm/yyyy), Volume
The point of the query is to retrieve the volume that was listed for the same month of the previous year. e.g. $1000 volume on 12/2009 would retrieve $XXX volume on 12/2008
I expect the code to look something like:
Volume_PreviousYear: DLookup([volume],[Monthly_Volume],[Criteria])
Does anyone know what I need to put for Criteria to get this to work?
Should I be using the DateAdd function???
Thanks in advanced for your time and help!
All the best,
Ben
I am having a problem creating a query that uses the monthly volume number and finds the corresponding volume for the same month of the previous year.
I am trying to use the DLookup function, but it only shows the first record it finds. To clarify:
Table: Monthly_Volume
Fields: Date(mm/yyyy), Volume
The point of the query is to retrieve the volume that was listed for the same month of the previous year. e.g. $1000 volume on 12/2009 would retrieve $XXX volume on 12/2008
I expect the code to look something like:
Volume_PreviousYear: DLookup([volume],[Monthly_Volume],[Criteria])
Does anyone know what I need to put for Criteria to get this to work?
Should I be using the DateAdd function???
Thanks in advanced for your time and help!
All the best,
Ben