Custom Row Heading Sorting in Crosstab Query!

Cold Zero

New member
Local time
Today, 10:45
Joined
May 12, 2018
Messages
9
[SOLVED] Custom Row Heading Sorting in Crosstab Query!

Hi,

Been searching this and tried everything I know with no luck

I have a table name tblOrder with field OrderID , OrderType and OrderStatus

I created a crosstab query to group by OrderType and count the total of orders, opened orders and closed orders


As you can see, the row heading is sorting ascending by OrderType (Parts, Services, Shipment)

How can I custom sort the row heading to show service in top, parts in middle and shipment at bottom

database is attached.
 

Attachments

Last edited:
June's idea won't work as these aren't column headers

Create an extra table tblOrderTypes with 2 fields OrderTypeID (PK, autonumber) & OrderType (text). Populate this in the order required: Service, Parts, Shipment.

Add this table to the crosstab query joining by OrderType & add the field OrderTypeID. You don't need to show the field unless you want to.
Sort by this in ascending order:

attachment.php


See attached

NOTE: Better still, use the OrderTypeID in tblOrders instead, link the 2 tables and enforce referential integrity. Modify your crosstab accordingl. I'll leave that to you
 

Attachments

Take a look at the query again. It is now sorting correctly without extra table involved.
 

Attachments

Ooops, yes, I didn't read entire question. Glad someone else jumped in.
 
June7
No problem
Also, based on your user name, happy birthday for tomorrow if that's the case.

Arnel
Neat use of Switch there
 
Thanks guys, you gave me more options to do it. Perfection
 
Nope, not my birthday, but thanks for the sentiment!
 

Users who are viewing this thread

Back
Top Bottom