Use a CASE WHEN in the same SELECT command?
up vote
1
down vote
favorite
1
A simple Select x, y , z from Table query is containing a "Case when" in the select. This field is ending as "End as 'result field'". I would like to use that 'result field' in another command as part of the same SELECT command (a Dateadd command). SELECT PositionDate, ISIN, Issuer, FirstCouponDate, TermLength, TermUnit, CASE WHEN TermUnit = 'Years' THEN 'year' WHEN TermUnit = 'Months' THEN 'month' END AS 'TermUnitRenamed', DATEADD(TermUnitRenamed, TermLength, FirstCouponDate), FROM GIBDataWarehouse.dbo.vw_Positions
sql case case-when dateadd
share ...