I would like to ask again for your help converting an excel formula to sql syntax.
the excel formula goes as follows:
Remaining Contract Length:
=IF(SalesOrderTypeCode="Blanket", ContractEndDate-IF(TodaysDate > ContractStartDate,IF(TodaysDate>ContractEndDate, ContractEndDate, TodaysDate),ContractStartDate)+1, 0)
I got help originally to convert the formula, but more logic was added to it this I need more help.
I currently have the formula in sql like this:
, RemainingContractLength =
WHEN SalesOrderLineTypeCode = 'BLANKET'
THEN DATEDIFF(dd, @Today, ContractEndDate) + 1
Thank you very much for your help.