Home Forums SQL Server 7,2000 T-SQL How can we calculate Age of employee? RE: How can we calculate Age of employee?

  • Hi,

    you can try this

    select EMP_CODE,DATE_OF_BIRTH ,DATEDIFF(DD,DATE_OF_BIRTH,getdate())/365 as years,(DATEDIFF(DD,DATE_OF_BIRTH,getdate())%365)/30 as months,

    DATEDIFF(DD,DATE_OF_BIRTH,getdate())%365%30 as days

    from EMP_MST where accountid=4

    Hitendra