Calculated column as range with IIF function
Posted: Tue Aug 04, 2015 10:39 am
Hi,
I'm trying to create a calculated column which will indicate the age range. This is done to create a Cross-Data Table, to evaluate the age of a population based on it's sex. I tried to do this:
IIF(Datos_Personales.Edad_Años < 19 ,"<19",
IIF(Datos_Personales.Edad_Años >= 19 & Datos_Personales.Edad_Años <= 21,"19-21",
IIF(Datos_Personales.Edad_Años >=22 & Datos_Personales.Edad_Años <= 24 ,"22-24",">24")
)
)
But all the registers are being marked as "19-21". Can you please explain me if I'm doing something wrong or if this is even possible to do? Other possibility was to create this condition on the Rows of the Tab, but it's still failing to do what I want to.
Thanks in advance.
I'm trying to create a calculated column which will indicate the age range. This is done to create a Cross-Data Table, to evaluate the age of a population based on it's sex. I tried to do this:
IIF(Datos_Personales.Edad_Años < 19 ,"<19",
IIF(Datos_Personales.Edad_Años >= 19 & Datos_Personales.Edad_Años <= 21,"19-21",
IIF(Datos_Personales.Edad_Años >=22 & Datos_Personales.Edad_Años <= 24 ,"22-24",">24")
)
)
But all the registers are being marked as "19-21". Can you please explain me if I'm doing something wrong or if this is even possible to do? Other possibility was to create this condition on the Rows of the Tab, but it's still failing to do what I want to.
Thanks in advance.