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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crosstab Query format question

Status
Not open for further replies.

stevebanks

Programmer
Mar 30, 2004
93
Hi,

I have a crosstab query that brings in reasons for returns and how much that has cost the company. Currently i have
Code:
TRANSFORM Sum([Report Data].Value) AS SumOfValue
SELECT[Report Data].[Orig Summary Reason] AS Summary_Reason, Sum([Report Data].Value) AS [Total Of Value]
FROM [Report Data]
GROUP BY [Report Data].[Orig Summary Reason]
PIVOT Format([Report Data].Action,"<>") In ("2nds stock","Break Down for Spares","Customer Kept","Dispose","Received not Processed","Return to Stock","Rework & Return to Stock");

This is working fine and producing reports etc, BUT, the remainder of the data where no "action" has been assigned doesn't appear as part of the table that is created, therefore the totals don't add up. I have tried adding just
Code:
 , "");
at the end, and that doesnt work either. Any ideas????


Thanks
 
Don't worry guys managed to sort this myself!

Code:
TRANSFORM Sum([Report Data].Value) AS SumOfValue
SELECT[Report Data].[Orig Summary Reason] AS Summary_Reason, Sum([Report Data].Value) AS [Total Of Value]
FROM [Report Data]
GROUP BY [Report Data].[Orig Summary Reason]
PIVOT [Report Data].Action) In ("2nds stock","Break Down for Spares","Customer Kept","Dispose","Received not Processed","Return to Stock","Rework & Return to Stock","");

just took out
Code:
 Format([Report Data].Action,"") IN

Just put
Code:
 [Report Data].Action IN

Hope this helps if you have the same problem as I did!

Thanks

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top