new to this been working on this for 6 hrs and can not seam to Google or find my way to an answer. I need to have two columns one for disbursement query 1 ("E%") and one for obligations query 2 ('C%' 'D%')that come from the the same table. Both query work but i need to get the first one to run the 2nd query. when i write in the 2nd all id does is sum for e,c,d not break it out between e, and (c,d)

both are looking at the ammount colum from stfhistory.
i just want to show in two columns not one. right know i get all the requested date with the ammount coloum giviving me the sum of 'e' type transactions with a.oer not '41%'. I need another column in query 1 that give me the sum ammount for 'c' or 'd' witheor not like '41%'. when i type in lines 3 and 4 from 2nd query it gives me one colum with sum of e,c,d with eor not like '41%', it does not break into to colums like i need

both are looking at the amount column from stfhistory.
i just want to show in two columns not one. right know i get all the requested data with the amount column giving me the sum of 'e' type transactions with a.oer not '41%'. I need another column in query 1 that give me the sum amount for 'c' or 'd' witheor not like '41%'. when i type in lines 3 and 4 from 2nd query it gives me one column with sum of e,c,d with eor not like '41%', it does not break into two columns like i need
[Updated on: Mon, 04 December 2006 10:11]
(what i want is to have one query that does both functions for amount, but in two separate columns)

select a.fy,a.appn,a.pm,a.sum (amount),b.sum(amount) from stfhistory a,sfthistory b
where fy='2007' and a.eor not like '41%'
and a.type_trans like 'E%'
or b.type_trans like 'C%'
or b.type_trans like 'D%'
group by a.fy,a.appn,a.pm
/

I have about 9 hours in this now. Worked great thanks for the help. Now i just need to bring it into a bigger query i am working on. For my education what does substr stand for? and the use of the 1, 1 i assume is to look at several qualifiers or am i wrong.

The only change i did was to take off the else 0 end. what is that piece telling the quarry?