How to use ASC in PIVOT ?

G

Guest

Hi, All
i have a query (all credits to Chis2)

TRANSFORM Nz(COUNT(TempTicks.Tick),0) AS CountOfTick
SELECT TempTicks.Badge
FROM TempTicks
GROUP BY TempTicks.Badge
PIVOT fWeekdayName(DatePart("w",TempTicks.IssDate)) & " " & TempTicks.IssDate;

the output looks like this:
Badge, Friday 06/22/2007, Monday 06/18/2007, Tuesday 06/19/2007
999, 1, 1, 1

Question: Is it possible to have output fields in ASC order?

Thank you, for your help
 
J

John Spencer

You could changing the pivot statement to (which will give you the number 1
to 7 and force a "sort" in that order).

PIVOT Format(ISSDate,"(w) dddd mm/dd/yyyy")


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

Thank you, it works great!

John Spencer said:
You could changing the pivot statement to (which will give you the number 1
to 7 and force a "sort" in that order).

PIVOT Format(ISSDate,"(w) dddd mm/dd/yyyy")


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top