Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Need help - Calculate last 4 month end / Quarter End dates! Expand / Collapse
Author
Message
Posted Thursday, September 24, 2009 9:15 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, June 16, 2010 12:45 PM
Points: 101, Visits: 65
Hi,
I am creating a report which has input as date (which is a month end Date) and option to run Monthly/Quarterly. If Monthly option is selected then for the selected date, the report should run for selected month end and previous 3 month ends showing summary data. Similarly if Quarterly option is selected and quarter end date is entered then it should run for selected quarter and previous 3 quarter ends showing summary data.

Eg. for Monthly. If 08/31/2009 is selected, need to calculate previous
3 month end dates: 07/31/2009, 06/30/2009, 05/31/2009

Eg. for Quarterly. If 06/30/2009 is selected, need to calculate previous
3 quarter end dates: 03/31/2009, 12/31/2008, 09/30/2008 (based on the Calender Year)

Sample Monthly report data if 08/31/2009 & Monthly options are selected:




Hi,

IamcreatingareportwhichhasinputASdate(whichISaMONTHENDDate)ANDOPTIONTOrunMonthly/Quarterly.IFMonthlyOPTIONISselectedTHENFORtheselecteddate,thereportshouldrunFORselectedMONTHENDANDprevious3MONTHendsshowingsummarydata.SimilarlyIFQuarterlyOPTIONISselectedANDquarterENDdateISenteredTHENitshouldrunFORselectedquarterANDprevious3quarterendsshowingsummarydata.



Eg.
FORMonthly.IF08/31/2009ISselected,needTOcalculateprevious

3
MONTHENDdates:07/31/2009,06/30/2009,05/31/2009



Eg.
FORQuarterly.IF06/30/2009ISselected,needTOcalculateprevious

3quarter
ENDdates:03/31/2009,12/31/2008,09/30/2008(basedONtheCalenderYEAR)



SampleMonthlyreportdataIF08/31/2009&Monthlyoptionsareselected:



05
/31/200906/30/200907/31/200908/31/2009

XXX1.11.221.321.5

YYY
-0.11-0.13-0.14-0.15

ZZZ5.23
%5.45%4.13%4.45%



SampleQuarterlyreportdataIF06/30/2009&Quarterlyoptionsareselected:



09
/30/200812/31/200803/31/200906/30/2009

XXX1.11.221.321.5

YYY
-0.11-0.13-0.14-0.15

ZZZ5.23
%5.45%4.13%4.45%



Thanks,

Devi




Sample Quarterly report data if 06/30/2009 & Quarterly options are selected:



Hi,

IamcreatingareportwhichhasinputASdate(whichISaMONTHENDDate)ANDOPTIONTOrunMonthly/Quarterly.IFMonthlyOPTIONISselectedTHENFORtheselecteddate,thereportshouldrunFORselectedMONTHENDANDprevious3MONTHendsshowingsummarydata.SimilarlyIFQuarterlyOPTIONISselectedANDquarterENDdateISenteredTHENitshouldrunFORselectedquarterANDprevious3quarterendsshowingsummarydata.



Eg.
FORMonthly.IF08/31/2009ISselected,needTOcalculateprevious

3
MONTHENDdates:07/31/2009,06/30/2009,05/31/2009



Eg.
FORQuarterly.IF06/30/2009ISselected,needTOcalculateprevious

3quarter
ENDdates:03/31/2009,12/31/2008,09/30/2008(basedONtheCalenderYEAR)



SampleMonthlyreportdataIF08/31/2009&Monthlyoptionsareselected:



05
/31/200906/30/200907/31/200908/31/2009

XXX1.11.221.321.5

YYY
-0.11-0.13-0.14-0.15

ZZZ5.23
%5.45%4.13%4.45%



SampleQuarterlyreportdataIF06/30/2009&Quarterlyoptionsareselected:



09
/30/200812/31/200803/31/200906/30/2009

XXX1.11.221.321.5

YYY
-0.11-0.13-0.14-0.15

ZZZ5.23
%5.45%4.13%4.45%



Thanks,

Devi





Thanks,
Devi

Post #793363
Posted Thursday, September 24, 2009 12:51 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:04 PM
Points: 7,125, Visits: 13,175
Please read and follow the instructions given in the link in my signature.
This will help you to get answers and help us to understand what you're struggling with.
The format you used doesn't really help...




Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Post #793513
Posted Thursday, September 24, 2009 1:06 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, June 16, 2010 12:45 PM
Points: 101, Visits: 65
It took lot of time for formatting the sample 3 line summary data. I tried to delete/edit the post (from original content) but I couldn't find such an option in this forum. It would be good to have such an option atleast for the person who is trying to post and if it accidently gets posted/ doesn't get formatted properly.
Next time I shall try to post the Questions properly.
Anyway thanks for your time and keep up the good work!

By the way I have found the solution for what I was looking for.

Have wonderful day!
Post #793524
Posted Thursday, September 24, 2009 1:16 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:04 PM
Points: 7,125, Visits: 13,175
If you look at the upper right hand side of your post you'll find a button named "EDIT ///".
So, this site has an option to edit your posts.
However, you cannot delete it. This will ensure -among other issues- data integrity, since it's possible to be referenced by a different post.
In case of special circumstances site owners might delete a post - but not without contacting the OP, I believe.

Edit: rephrased.




Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Post #793533
Posted Thursday, September 24, 2009 1:18 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, June 16, 2010 12:45 PM
Points: 101, Visits: 65
Yup, I tried that EDIT/// button and that is how I ended up with this mess :-( !
Post #793534
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse