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.

 All Forums
 Other Forums
 MS Access
 Using PIVOT in Access

Author  Topic 

harsha123_8
Starting Member

2 Posts

Posted - 2004-07-07 : 22:59:32
I am using a crosstab query and using following statement as part
of the query to get sales results.

PIVOT Format(salesdate, 'yyyy')

Result will be

Product 2001 2002 2003 2004
A
B
C

Now i want to get it for financial year. That is from 1st April previous year to 31st March current year. (Eg. 1st April 2001-31st March 2002, 1st April 2002 - 31st March 2003 etc..)

like this

Product 2001/2002 2002/2003 2003/2004
A
B
C

Can any genius help please.





AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-07-08 : 04:01:04
i think you'll need some sort of mapping table to define the relationship between calendar dates and financial periods....

ie....
01/May /2001 is in Q1-FYR-01-02 and thus also in FYR-01-02
07/Aug /2001 is in Q2-FYR-01-02 and thus also in FYR-01-02
15/Sept/2001 is in Q2-FYR-01-02 and thus also in FYR-01-02
31/Dec /2001 is in Q3-FYR-01-02 and thus also in FYR-01-02
08/Feb /2002 is in Q4-FYR-01-02 and thus also in FYR-01-02
11/May /2002 is in Q1-FYR-02-03 and thus also in FYR-02-03
17/Aug /2002 is in Q2-FYR-02-03 and thus also in FYR-02-03
25/Sept/2003 is in Q2-FYR-03-04 and thus also in FYR-03-04
31/Dec /2003 is in Q3-FYR-03-04 and thus also in FYR-03-04
08/Feb /2004 is in Q4-FYR-03-04 and thus also in FYR-03-04


The middle step is currently overkill for your stated requirements....but if your users are anything like my crowd...then as soon as you give them full year figures...you'll also need to give them quarter-on-quarter stuff as well!!!
Go to Top of Page
   

- Advertisement -