RE: Cross Tab Query

From: Daud (Daud_at_discussions.microsoft.com)
Date: 02/07/05


Date: Sun, 6 Feb 2005 22:29:02 -0800

Than u very much dear u were the only who replied my and understand the
issue. But unfortunately u have give the example for static entry I need
dynamic one in the form that whatever records are entered in the table in the
form they autometically comes in this way.
The table name is T_GCombDetail and the fields are:
Comb T3 Per
1 80286 50
1 37395 50
2 80286 100
3 37385 100
4 80286 30
4 37395 70

I need the result in this way after quering
Comb 80286 37395
   1 50 50
   2 100
   3 100
   4 30 70

Waiting for your response,
With Regards,

"Nigel Rivett" wrote:

> select year ,
> A = (select QTY from tbl t2 where t.year = t2.year and item = 'A') ,
> B = (select QTY from tbl t2 where t.year = t2.year and item = 'B') ,
> C = (select QTY from tbl t2 where t.year = t2.year and item = 'C')
> from tbl t
> group by year
> order by year
>
>