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

Tabular Format With Sums

Status
Not open for further replies.

NeoTurtle

Programmer
Aug 25, 2000
38
US
Hello everyone,

I am writing an ASP script to display data from our sales reps in a tabular format with sums for each item (Style) per sales rep. I've searched all over here and google'd everything... UNIONS, JOINS, PIVOTS with no luck.

This is the table:
Code:
Style Color SalesRep Units [CustNumb OrderDate ShipDate ETC....]
1234  black AAA      2
1234  black AAA      3
1234  black BBB      3
1234  black BBB      3
1234  black CCC      30
1234  black CCC      2
2344  green AAA      7
1234  white BBB      3
1234  white BBB      13

This is what I'd like to see:
Code:
Style Color AAA BBB CCC
1234  black 5   6   32
2344  green 7
1234  white     13

Thanks in advance!
 
This looks like a crosstab query wiht Style and Color as Row Headings, SalesRep as the Column Heading, and Sum(Units) as the Value.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks for the reply. I just did this in Access with a Pivot Table which will work for what I need... but I'd still like to know what the query would look like and try to do this in ASP. It's just something that I think would be nice to know how to do. I'll try to mess around with it throughout the week to see what I can come up with...

Thanks again!
 
Follow the Crosstab query wizard and then have a look at the code in the SQL view pane of the generated query.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top