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

cross tab query 1

Status
Not open for further replies.

aarellano

MIS
Oct 22, 2007
168
US
Hello,

I have a sql statement that creates like a corsstab query.
Code:
select mainf.gel.gln, sum(case mainf.gel.gltyp when 1 then mainf.gel.pdr05-mainf.gel.pcr05 else 0 end)  MayCurrent,

sum(case mainf.gel.gltyp when 2 then mainf.gel.pdr05-mainf.gel.pcr05 else 0 end) MayBudget

from mainf.gel group by mainf.gel.gln
This works very well,
the problem that I have is that for the pdr and pcr I have
pdr01 pcr01
pdr02 pcr02
pdr03 pcr03
pdr04 pcr04
and so on up to 12

I am not sure how I would put that into my sql statement


Any help is appreciate it



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top