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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crosstab Field Layout

Status
Not open for further replies.

Bass71

MIS
Jun 21, 2001
79
I have created a crosstab query using the recordset 'month' as the pivot recordset. However, the results of the crosstab query show the new month fields in alphabetical order, not month order--reading left to right. There is a parameter that asks the user to key in a reference month which yields a four month output. So, the months from the resulting query will vary.
Is there anyway to solve this layout issue?

Here is the SQL view of the crosstab... Thanks for your help!!

PARAMETERS [Enter Review Month/Year] Text;
TRANSFORM Sum(Query1.[SumOfSumOfPrincipal Cash]) AS TheValue
SELECT Query1.TAS, Query1.[Account Title], Query1.[Relationship Name], Query1.Group, Query1.[Date Opened], Query1.[First day Activity], Query1.[Dollar Volume]
FROM Query1
GROUP BY Query1.TAS, Query1.[Account Title], Query1.[Relationship Name], Query1.Group, Query1.[Date Opened], Query1.[First day Activity], Query1.[Dollar Volume]
PIVOT Query1.Month;
 
you need to use the Month(query1.Month) as the pivot. Although it is not clear from the SQL, I would guess that query1.month is the month NAME. sinec you may be using this for other purposes, I'll not suggest chnging it, but to add a new calculated field in query1, which will be the month NUMBER. I'm streching here, and will assume that Query1.[Month], is the month name of Query1.[Date Opened], so I'll suggest Month(Query1.[Date Opened]) This would be:

MnthNum: Month([Date Opened] (in query1) and the pivot in the XTab query is then "MnthNum".

MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top