I hope that this will be simple for you -
I have a table which includes the fields Date of Birth and Age Group.
Age Group is based on the persons age so I created a query (qryAge) to calculate age using the statement: DateDiff("yyyy",[DOB],Now())+Int(Format(Now(),"mmdd")<Format([DOB],"mmdd"))
This query works fine and when i run it it displays each persons age.
Now to calculate the Age group I have created an update query which when run will update the Age Group field, however it does not work. The if statement I have used is -
IIf([qryAge]![Age]<"18","Under 18",(IIf([qryAge]![Age]>"17" And [qryAge!Age]<"35","Under 35",(IIf([qryAge]![Age]>"34" And [qryAge]![Age]<"45","Under 45",(IIf([qryAge]![Age]>"44" And [qryAge!Age]<"55","Under 55",(IIf([qryAge]![Age]>"44","55+")))))))))
If someone could tell me what is wrong it would be very greatly appreciated, as no matter what I try i cannot get it to work!
I have a table which includes the fields Date of Birth and Age Group.
Age Group is based on the persons age so I created a query (qryAge) to calculate age using the statement: DateDiff("yyyy",[DOB],Now())+Int(Format(Now(),"mmdd")<Format([DOB],"mmdd"))
This query works fine and when i run it it displays each persons age.
Now to calculate the Age group I have created an update query which when run will update the Age Group field, however it does not work. The if statement I have used is -
IIf([qryAge]![Age]<"18","Under 18",(IIf([qryAge]![Age]>"17" And [qryAge!Age]<"35","Under 35",(IIf([qryAge]![Age]>"34" And [qryAge]![Age]<"45","Under 45",(IIf([qryAge]![Age]>"44" And [qryAge!Age]<"55","Under 55",(IIf([qryAge]![Age]>"44","55+")))))))))
If someone could tell me what is wrong it would be very greatly appreciated, as no matter what I try i cannot get it to work!