Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • RE: Age as of January 1st

    Sorry, my previous reply had a bug for computing ActualAgeOnJan1.  Corrected code:

    ;
    WITH cte
    AS (
        SELECT CAST(BirthDate AS DATE) AS BirthDate
            ,CAST(ServiceDate AS DATE) AS...

  • RE: Age as of January 1st

    ;
    WITH cte
    AS (
        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'),

Viewing 2 posts - 1 through 2 (of 2 total)