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  

"Unnormalize" table



 
 
Thread Tools Display Modes
  #1  
Old February 12th, 2008, 12:00 PM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 3
Default "Unnormalize" table

Hello

I have a table which looks like this:

DRG Patient Costs
==================
A a 10
A b 20
A c 15
B a 30

and so on. Now I have to convert it to something like this:


DRG Costs1 Costs2 Costs3
============================
A 10 20 15
B 30

Very ugly but I need it this way for Excel.
How can I do that?
  #2  
Old February 12th, 2008, 12:19 PM posted to microsoft.public.access.queries
Gary Walter
external usenet poster
 
Posts: 613
Default "Unnormalize" table


julius.fuchs wrote:

Hello

I have a table which looks like this:

DRG Patient Costs
==================
A a 10
A b 20
A c 15
B a 30

and so on. Now I have to convert it to something like this:


DRG Costs1 Costs2 Costs3
============================
A 10 20 15
B 30

Very ugly but I need it this way for Excel.
How can I do that?


It really depends on what your data really
looks like (and what you really want)...

for example, using your data (if table.name="yurtable")

TRANSFORM First(t.Costs)
SELECT
t.DRG
FROM
yurtable AS t
GROUP BY
t.DRG
PIVOT "Costs_" & t.Patient;

above crosstab would produce


DRG Costs_a Costs_b Costs_c
============================
A 10 20 15
B 30

My guess is that your data and wanted-results
are more complicated?

good luck,

gary


 




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


All times are GMT +1. The time now is 01:28 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.