G
Gil Lopes
Hi all!
I need to build a query that returns a daily change from a table.
I need something like this:
Date Value@date Value@date-1 (Value@date / Value@date-1) - 1
Or else, just the first and last field.
Now, I understand I must have a subquery, but I' m not sure how to do it.
SELECT MyTable.Date , [Value]/DLookUp("[value]","[MyTable]","[date]=([date]-1)
") AS [%Change],
FROM MyTable (...)
I tried this aproach, but it doesn' t retreive the desired values.
I also include some criteria on the date field and a product ID criteria, but
I guess the problem is somewhere in the SQL above. I looked for solutions in
previous posts around, but couldn' t solve this.
Any hints?
Thanks,
Gil
I need to build a query that returns a daily change from a table.
I need something like this:
Date Value@date Value@date-1 (Value@date / Value@date-1) - 1
Or else, just the first and last field.
Now, I understand I must have a subquery, but I' m not sure how to do it.
SELECT MyTable.Date , [Value]/DLookUp("[value]","[MyTable]","[date]=([date]-1)
") AS [%Change],
FROM MyTable (...)
I tried this aproach, but it doesn' t retreive the desired values.
I also include some criteria on the date field and a product ID criteria, but
I guess the problem is somewhere in the SQL above. I looked for solutions in
previous posts around, but couldn' t solve this.
Any hints?
Thanks,
Gil