07-12-2017 11:24 AM
Thanks for Checking!
I am trying to calculate the age for each person , but I am getting the same age 52 for all the accounts. Please help
create table test.age
as select acct,
int(yrdif(s.Birth_year1,today())) as Age
from test.data s;
07-12-2017 11:32 AM - edited 07-12-2017 11:33 AM
So, how does one calculate an age from a date and year? What are you expecting as the answer?
FYI - this is a logic issue/problem definition not an actual programming problem.
07-12-2017 11:44 AM
Whats the formula though? Age is usually calculated based on dates but you don't have dates so you can't calculate an exact age. So how do you want to calculate age?
Is it use a mid year value? Or just pick highest age? Or stand on one foot and throw a dart? I can show you code for all...including the last option.
Need further help from the community? Please ask a new question.