SQL Query Question



Hi all,

I am trying to achieve the following:

Table A has a structure like this:

TransactionNumber (autonumber PK)
Quantity
ProductTypeID (let's say this can have the value 1,2, or 3)
Date

I want to query this data to produce a data structure where each row
has a date (I will get this from a temp table of all dates in my
desired range), then the SUM of any rows containing that date, with
each of the three product types being a column.

So an example row in the resultset would look like:

April 1, 2006;877;155;5

...calculated from the database rows:

188;577;1;April 1, 2006
194;155;2;April 1, 2006
199;5;3;April 1, 2006
204;300;1;April 1, 2006

I do have a solution but it is not very elegant and I am wondering what
others may make of the problem. Is it possible to do this using SQL
only?

.