Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Age Range

Status
Not open for further replies.

gwendon

Technical User
Apr 7, 2002
23
US
I have a column that provides me age based on the following
Age: Int(DateDiff("d",[DateOfBirth],Date())/365.25)

What I need is an AGE RANGE, for example people between age 50 and 60
 
Put this in a column of your query.

AgeRange:IIf(Age < 20,&quot;Less than 20&quot;,IIf(Age < 30, &quot;20 - 30&quot;,IIf(Age < 40, &quot;30 - 40&quot;,IIf(Age < 50, &quot;40 - 50&quot;, IIf(Age < 60, &quot;50 - 60&quot;,&quot;Greater than 60&quot;)))))

You can adjust the output values to whatever suits you.


Paul
 
look up the partition function in HELP, and 'help youself' to some understanding.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Paul I wish to thank you for your help. I ended up with =>
AgeRange20: IIf([Age]>19,IIf([Age]<30,[Age]))
And it works very well thanks to you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top