Hi and thanks for taking the time to help with my question.
I have one table with two fields:
Date (dd/mm/yy)
Sales (number eg 17)
I have a query that returns both columns and hence the sales on each date.
I would like to add another field to the query that returns the sales on the previous day, called 'previous'.
I think I need to use a subquery but I'm not sure of the syntax. I know how to use dateadd to get for example the date of the previous day but this needs to be worked into a subquery that uses it to lookup the sales field against the returned date from dateadd.
Any help would be much appreciated!
Cheers, Scott.
I have one table with two fields:
Date (dd/mm/yy)
Sales (number eg 17)
I have a query that returns both columns and hence the sales on each date.
I would like to add another field to the query that returns the sales on the previous day, called 'previous'.
I think I need to use a subquery but I'm not sure of the syntax. I know how to use dateadd to get for example the date of the previous day but this needs to be worked into a subquery that uses it to lookup the sales field against the returned date from dateadd.
Any help would be much appreciated!
Cheers, Scott.