If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Column Headings
Access 2000
TRANSFORM Count(Demographics.[NHS Number]) AS [CountOfNHS Number] SELECT Demographics.Hospital, Count(Demographics.[NHS Number]) AS [Total Of NHS Number] FROM Demographics GROUP BY Demographics.Hospital PIVOT Demographics.[Primary diagnosis]; Q - How to I change Column Heading Total of NHS Number to Total Q - How to I change Primary diagnosis headings from bound column heading C48 to text string associated with it "Peritoneal" |
#2
|
|||
|
|||
"MDW" wrote:
Access 2000 TRANSFORM Count(Demographics.[NHS Number]) AS [CountOfNHS Number] SELECT Demographics.Hospital, Count(Demographics.[NHS Number]) AS [Total Of NHS Number] FROM Demographics GROUP BY Demographics.Hospital PIVOT Demographics.[Primary diagnosis]; Q - How to I change Column Heading Total of NHS Number to Total Q - How to I change Primary diagnosis headings from bound column heading C48 to text string associated with it "Peritoneal" Hi MDW, If you don't already have a way of translating "C48" to "Peritoneal" from your existing data, then it sounds to me like you need a translation table DiagTrans Diag Trans C48 Peritoneal .... .... Then your query might look like: TRANSFORM Count(D.[NHS Number]) AS [CountOfNHS Number] SELECT D.Hospital, Count(D.[NHS Number]) AS [Total] FROM Demographics As D LEFT JOIN DiagTrans As DT ON D.[Primary diagnosis] = DT.Diag GROUP BY D.Hospital PIVOT SWITCH(DT.Trans IS NULL, D.[Primary diagnosis], True, DT.Trans); If you could be assured that every Primary diagnostic value was accounted for in the translation table, then you would not need the Switch stmt in PIVOT clause: PIVOT DT.Trans; Of course I may have misunderstood completely. Good luck, Gary Walter |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
rename Column Headings | JR | General Discussion | 5 | August 13th, 2004 12:24 AM |
Column Headings | Brian | General Discussion | 1 | August 6th, 2004 12:30 AM |
Reversing Sign on Column of Data (Positive to Negative) (Negative to Postive) | M Stokes | Worksheet Functions | 1 | April 26th, 2004 04:33 PM |
column headings | Ruth | Setting up and Configuration | 1 | September 17th, 2003 03:10 AM |