Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rows to Colums

Status
Not open for further replies.

Jell0b0y

Technical User
Jul 20, 2007
6
US
Hello,
I am trying to make a field in that displays in rows to show in colums. The field is "IDCASE00".IDLTYP" it has three entries OSS, RSV and TRL. When I run the SQL below I get the following results

SKUA 100 RSV
SKUA 125 OSS
SKUA 200 TRL

but I need it to be like the following

SKUA 100 125 200

Can this be done? I am new to SQL and any assistants would be greatly appricated.

Thank you

SELECT "PHPICK12"."PHPSTF", "PDPICK00"."PDPCTL", "PDPICK00"."PDPIQT", "IDCASE00"."IDLTYP", "IDCASE00"."IDSTYL", "IDCASE00"."IDSSFX", "IDCASE00"."IDCOLR", "IDCASE00"."IDCSFX", "IDCASE00"."IDQUAL", "IDCASE00"."IDSDIM", "IDCASE00"."IDSZDS",
SUM ("IDCASE00"."IDQTY")
FROM ("MDCPKMSP"."K231WBPRDD"."PHPICK12" "PHPICK12" INNER JOIN "MDCPKMSP"."K231WBPRDD"."PDPICK00" "PDPICK00" ON "PHPICK12"."PHPCTL"="PDPICK00"."PDPCTL") INNER JOIN "MDCPKMSP"."K231WBPRDD"."IDCASE00" "IDCASE00" ON ((((("PDPICK00"."PDSTYL"="IDCASE00"."IDSTYL") AND ("PDPICK00"."PDSSFX"="IDCASE00"."IDSSFX")) AND ("PDPICK00"."PDCOLR"="IDCASE00"."IDCOLR")) AND ("PDPICK00"."PDCSFX"="IDCASE00"."IDCSFX")) AND ("PDPICK00"."PDSDIM"="IDCASE00"."IDSDIM")) AND ("PDPICK00"."PDSZDS"="IDCASE00"."IDSZDS")
WHERE "IDCASE00"."IDSTAT"='30'
GROUP BY "IDCASE00"."IDSTYL", "IDCASE00"."IDSSFX", "IDCASE00"."IDCOLR", "IDCASE00"."IDCSFX", "IDCASE00"."IDQUAL", "IDCASE00"."IDSDIM", "IDCASE00"."IDSZDS", "IDCASE00"."IDLTYP", "PHPICK12"."PHPSTF", "PDPICK00"."PDPCTL", "PDPICK00"."PDPIQT
 
I can't read your post (try to include some spaces) but because of all the extra parens it appears you are using MS Access. Try forum701

Hope this helps,

Alex

[small]----signature below----[/small]
I don't do any programming whatsoever

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top