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

assign a marker based on totals

Status
Not open for further replies.

sap1958

Technical User
Oct 22, 2009
138
US
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
 
Hi,

I have a couple of questions for you - first of all would it be possible to see the whole query and secondly what version of SQL Server are you using?

Regards,
Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top