How do I recode data in a query?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field for 'age' and I want to create one for 'agegroups' and convert
the data from age to agegroup, eg. all ages between 0 and 15 years to become
agegroup=1, between 16 and 30 to become agegroup=2 etc. How do I do it?
Thanks
 
In an open column of the QBE grid enter:
AgeGroup: IIf([Age]>0 And [Age]<=15,1) & IIf([Age]>15 And [Age]<=30,2) &
IIf([Age]>30 And [Age]<=45,3)
By the way, I hope the field you have for age is calculated from date of
birth.
Hope that helps.
Ed
 
Back
Top