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

How to format or order the Row Heading in a Crosstab query 1

Status
Not open for further replies.

jckokko

Programmer
Jun 4, 2001
31
US
Here's my query that returns what I need. This query sorts the tblContribution.Type in ascending order:

PARAMETERS [Forms]![YearlyReport]![Start] DateTime, [Forms]![YearlyReport]![Start] DateTime;
TRANSFORM Sum(tblContribution.Amnt) AS AmntOfSum
SELECT tblContribution.Type, Sum(tblContribution.Amnt) AS Total
FROM tblContribution
WHERE (((tblContribution.Date)>=[Forms]![YearlyReport]![Start] And (tblContribution.Date)<=[Forms]![YearlyReport]![Start]))
GROUP BY tblContribution.Type
PIVOT Format([Date],"mm") In ("12","01","02","03","04","05","06","07","08","09","10","11");

Let say that the values of tblContribution.Type is A through Z, and I want the order to be B, C, Z, H, Q, ...
Is there a way to format the tblContribution.Type the way I want?
 
Create a table with fields and values like:
[tt]
Type Seq
===== ===
B 1
C 2
Z 3
H 4
Q 5
... ...
[/tt]

YOu can place any values you want in the Seq field and then use it to sort your report/query.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top