This is known as a cross-tabulation query, complicated by the use of two
values to produce the columns.  If your database is MS Access, look up the
TRANSFORM statement.  If your database is SQL Server, search the web for
CrossTab, and you should get some samples.  Note however, that many of these
articles only deal with limited crosstab implementations, and not the
general case for any number of values.

HTH,
Tore.

-----Original Message-----
From: Joe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 12:24 PM
To: ActiveServerPages
Subject: creating a matrix report


Hi.  I am trying to create a report that is basically based on an excel
spreadsheet.  The column (company) and row headers (date & product) have to
be generated dynamically.  The cells of the report would then be a total
amount for each product on each date.  Example:

              date 1    date 2
              prod 1    prod 2
comp 1         3          5
comp 2         7          0

So the problem I am having is I need to have a date, a productID, and a
Company ID in order to get the correct totals.  No matter how many stored
procs I write or how I loop through the data I am just not getting this
though (I can pull the data I need without a problem).  I've tried to do it
an array, but I still can't get this to display correctly (I am not very
experienced with arrays though).  I can get all the headers on the columns
and rows printed out, but when it's time to start looping through the data
for the cells, I've lost all my ID's.  

I have a feeling I am going about this all wrong or that I am missing
something obvious.  Any advice on how I should look at this would be greatly
appreciated.  I am the lone developer here so I don't have the benefit of a
second set of eyes.  Thanks.  joe  

---
You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to