Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
dPriya
Starting Member
4 Posts |
Posted - 2011-07-21 : 02:48:16
|
hiiiii...I am working on SSRS 2008.In my SSRS report there is one parameter called postdate and second parameter as periodlength.periodlength parameter has multiple values ie 1month,2month,3month,7days and 6months.now i want to calculate sale according to value which is entered in periodlength till date which entered in postdate.So can u please tell me the query to calculate sale according to periodlength parameter. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-07-21 : 04:29:09
|
so is periodlength a multiselect? based on selection how would report format be?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
dPriya
Starting Member
4 Posts |
Posted - 2011-07-22 : 00:30:03
|
hiii...sir,Periodlength is a multivalue parameter i.e if user entered value 2months in periodlength parameter then there is a field called saleamount in that table,then pie chart contains a slot of 2 months(i.e jana nd feb one slot,march and April one slot and so on..) and addition of that two months amount.if user entered 3 months in periodlength parameter,then pie chart contains a slot of 3 months(i.e jan,feb and march one slot,and so on..) and addition of that three months amount. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-07-22 : 11:04:42
|
it will be likeSELECT YEAR(salesdate),(MONTH(salesdate)-1)/@PeriodLength AS Slot,SUM(salesamont) AS TotalSalesFROM SalesTableGROUP BY YEAR(salesdate),(MONTH(salesdate)-1)/@PeriodLength ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|
|
|