04-21-2014 09:21 AM
1. We have a data set where every day new data will be appended to the data set. He wants the last week total transaction amount by the product, however, it should be dynamic.
04-21-2014 09:28 AM
sum(amount) as transaction_amount
DateAdded >= date()-7
group by product;
04-21-2014 09:32 AM
You can use %sysfunc(today()) to get last week number and get the amount of transaction .