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:29:56
|
hi..I am doing reporting in SSRS using SQL server 2008.I want to show weekly,monthly and quarterly sale for date whichever date is entered in date parameter. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-07-21 : 04:28:21
|
we need more info like how is structure of your sales table,what are aggregations you want to show, what according to you represents sale year etc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
dPriya
Starting Member
4 Posts |
Posted - 2011-07-22 : 00:39:31
|
hiii sir,I am having one table cust_ledger_entry.This table contains the field Posting Date and Amount.In my SSRS report there in two parameter Posting Date and PeriodLength.PeriodLength is multivalue parameter contains parameter like 1month,2month,3month,4month and 7days.For example,suppose user entered 31-12-2000 in posting date and 2month in periodlength,then chart should show each slot of two months.means one slot is from 1-11-2000to31-12-2000,second slot is from 1-09-2000to31-10-2000 and so on...and sum of Amount of that perticular two months as data lable. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-07-22 : 11:41:27
|
logic same as herehttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=163315SELECT MIN(postingdate) AS StartDate,MAX(postinfdate) AS EndDate,SUM(salesamount) AS TotalSalesFROM cust_ledger_entryWHERE postingdate BETWEEN DATEADD(yy,DATEDIFF(yy,0,@Date),0) AND @DateGROUP BY (DATEDIFF(mm,postingdate,@Date)-1)/@Periodlength ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|
|
|