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

Compiling Data

Status
Not open for further replies.

swicklund

Technical User
Apr 26, 2005
10
0
0
US
I am in the process of collating & quantifying customer return data, and have a table that I am entering return information (i.e. Return Date, Return Code (reason for the return), $ of the Return, etc...) What I would like is to compile this data into a table that has the monthly totals based on the Return Code (so, I will end up with one column for each return code). I will then use this table to create a chart (I know how to do the chart, but need help compiling the data).

Any help would be most appriciated!!!!

Thank you,
 
You'll need a cross tab query to get a column for each returnCode. First start off with your basic query:
Code:
SELECT ReturnCode, Sum(ReturnAmt) From TableName Where ReturnDate between #1/1/2007# and #1/31/2007# GROUP BY ReturnCode
Then use the cross tab query wizard to transpose the data.

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top