Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crosstab Query Date

Status
Not open for further replies.

Hayton

Technical User
Oct 17, 2001
257
NZ
Hi Everyone,

I have CTQuery that limits the data to 12 months. I need to be able view 3 years data by month (36 month. Is there a way i can do this.

TRANSFORM Sum([qryGeberal ii].Cost) AS SumOfCost
SELECT [qryGeberal ii].FltDesc, [qryGeberal ii].Axle, [qryGeberal ii].Event, Sum([qryGeberal ii].Cost) AS [Total Of Cost]
FROM [qryGeberal ii]
GROUP BY [qryGeberal ii].FltDesc, [qryGeberal ii].Axle, [qryGeberal ii].Event
PIVOT Format([Date],"mmm") In ("Jan","Feb ","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");



Hayton McGregor

 
Hi

I'll take a stab at this by suggesting that if you
have a year and month field in your root table/query
you can concatinate them into another field like so 200501 and then run the crosstab based on this.
I have used this recently for 24 month report.
Hope it helps

Cheers
 
Thanks for the Tip. It worked out.

Hayton McGregor

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top