A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Column Headings



 
 
Thread Tools Display Modes
  #1  
Old October 13th, 2004, 09:57 AM
MDW
external usenet poster
 
Posts: n/a
Default 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  
Old October 13th, 2004, 02:22 PM
Gary Walter
external usenet poster
 
Posts: n/a
Default

"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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 06:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.