sum(case when a.coreid=b.coreid and b.giftacctdv = '12'
and b.gifteffdat between '7/1/2009'and '6/30/2010' then b.giftlinetotal else 0 end) as FY10,
sum(case when a.coreid=b.coreid and b.giftacctdv = '12'
and b.gifteffdat between '7/1/2008'and '6/30/2009'then b.giftlinetotal else 0 end) as FY09,
If the FY10 is >0 then I want to establish a column called 'GAVELASTYEAR' and mark it 'Y'
If the FY09 is >0 and FY10 = 0 then I want to establish a column called 'GAVESOMEYEAR' and mark it 'Y'. However if both FY09 and FY10 are >0 then only FY10 should be marked, not both. Essentially FY10 determines whether FY09 will get a mark. How can I accomplishe this
and b.gifteffdat between '7/1/2009'and '6/30/2010' then b.giftlinetotal else 0 end) as FY10,
sum(case when a.coreid=b.coreid and b.giftacctdv = '12'
and b.gifteffdat between '7/1/2008'and '6/30/2009'then b.giftlinetotal else 0 end) as FY09,
If the FY10 is >0 then I want to establish a column called 'GAVELASTYEAR' and mark it 'Y'
If the FY09 is >0 and FY10 = 0 then I want to establish a column called 'GAVESOMEYEAR' and mark it 'Y'. However if both FY09 and FY10 are >0 then only FY10 should be marked, not both. Essentially FY10 determines whether FY09 will get a mark. How can I accomplishe this