Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Showing the last X Specific Day Parameter (i.e. last 5 Tuesdays)

$
0
0

Hi all, I hope you can help. I have a customer (Bakery) who has sales figures, and he wants to see his sales for specific products over the last X Tuesdays/Wednesdays, to see when he sells out of these products so he can order more/less for the following day week.

How would I do this with a parameter, so I can then group this in to a comparison-like report. 

Would it be easier to do it in the SQL Query?

Edit - I'm thinking of having a parameter for the day and the amount of days to list, but I can't get the SQL syntax right, can you do a top on a datapart? Like below:

'AND Top @XWeeksToRun DatePart(dw,SessionDate) = @Day'

Also, will DatePart(dw) group all Tuesdays in to a single lump, or do separate lines for each different day? I need it to group by the date so you can compare them.



Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>