how to calculate age from DOB year
i using query year(getdate())
tahir ayoub
- year(patient_birth_year)
- case when month(patient_birth_year) > month(getdate()) 1
when month(patient_birth_year) < month(getdate()) 0
when day(patient_birth_year) >day(patient_birth_year) 1
else 0
end
dont know weather right or not giving results same answer
showing patients same age i.e 106 dont know why
can tell me how deal
or give me query need calculate age dob
dob column name (patient_birth_year)
dont know weather right or not giving results same answer
showing patients same age i.e 106 dont know why
can tell me how deal
or give me query need calculate age dob
dob column name (patient_birth_year)
tahir ayoub
you cannot have select in named calculation.
have
year(getdate())-patient_birth_year
vinu
SQL Server > SQL Server Analysis Services
Comments
Post a Comment