1
I need to check in my SELECT if the field e. Dating back to is between 30 and 90 days from today’s date. How to make the condition in CASE ?
SELECT
e.NmrCnt AS [Contrato]
,e.NmrSerie AS [Serie]
,e.DataAfr AS [Data Aferição]
,e.DataTrm AS [Data Término]
,CASE
WHEN e.DataTrm < GETDATE() THEN 'Vencida'
WHEN CONDIÇÃO THEN 'Vence em 30 à 90 dias'
END AS [Status]
FROM
tbl_Eqp e
Which database?
– Ricardo
SQL Server 2012
– Raphael Prado de Oliveira