Viewing 2 posts - 1 through 2 (of 2 total)
Sorry, my previous reply had a bug for computing ActualAgeOnJan1. Corrected code:
;WITH cteAS ( SELECT CAST(BirthDate AS DATE) AS BirthDate ,CAST(ServiceDate AS DATE) AS...
February 1, 2017 at 11:15 pm
#1926251
;WITH cteAS ( SELECT CAST(BirthDate AS DATETIME) AS BirthDate ,CAST(ServiceDate AS DATETIME) AS ServiceDate FROM ( VALUES ( '01/01/1951', '2016-01-01'), ( '01/01/1951', '2016-08-26'), ( '01/02/1951', '2016-08-26'),
February 1, 2017 at 7:00 pm
#1926226