Try this:
(SELECT DISTINCT A.AppointmentId
, U.UserId
, U.FirstName
, U.UserEmail
, (DATEDIFF(DAY, U.DOB, GetDate()) / 365.25) AS DOB
, C.CompanyName
, A.TimeStart
, A.Reason
, A.Status
, A.PatientFirstName AS FName
, A.PatientLastName AS LName
, A.PatientGender
, (DATEDIFF(DAY, A.PatientDOB, GetDate()) / 365.25) AS PatientDOB
FROM
Appointment A, Users U, Company C
WHERE
A.UserId = U.UserId
AND A.CompanyId = @CompanyId
AND A.ProviderId = @ProviderId
AND A.Date = @Date
AND C.Id = A.CompanyId)
UNION
(SELECT DISTINCT A.AppointmentId
, E.EmployeeId
, E.Name
, E.Email
, (datediff(DAY, E.DOB, GetDate()) / 365.25) AS DOB
, C.CompanyName
, A.TimeStart
, A.Reason
, A.Status
, A.PatientFirstName AS FName
, A.PatientLastName AS LName
, A.PatientGender
, (DATEDIFF(DAY, A.PatientDOB, GetDate()) / 365.25) AS PatientDOB
FROM
Appointment A, Employee E, Company C
WHERE
A.UserId = E.EmployeeId
AND A.CompanyId = @CompanyId
AND A.ProviderId = @ProviderId
AND A.Date = @Date
AND C.Id = A.CompanyId)
Refer:
sql age function[
^]
calculate age on date of birth[
^]
Date Calculations: calculate ages[
^]