Answers for "sql server get last 2 of year"

SQL
1

sql where last 12 months

select Dateadd(Month, -12, GETDATE())
Posted by: Guest on June-10-2020
0

sql get latest of 2 datetimes

SELECT ID,
       CASE WHEN 
              COALESCE(Date1, '1/1/1973') > COALESCE(Date2, '1/1/1973') -- COALESCE is to ensure comparison works when 1 is nullable
         THEN Date1
         ELSE Date2
       END AS MostRecentDate
FROM Table
Posted by: Guest on February-18-2021

Code answers related to "sql server get last 2 of year"

Code answers related to "SQL"

Browse Popular Code Answers by Language