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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Ranges of Values 2

Status
Not open for further replies.

benesch

Technical User
Apr 19, 2001
18
0
0
US
Hi:

I am using a table containing birth dates of assisted living facility residents. I calculate each person's age using a query. The result is calculated out to 13 decimal places. I need to calculate the number of residents whose age falls into specified ranges:

<60, >= 60 and < 65, >=65 and < 70, etc.

I used the Partition function: Partition([Resident Age], 60,5, 100). The problem that I am having is tha, for example, a resident aged 64.7 is rounded to 65, and is treated as falling in the >=65 and < 70 category. I would like such a resident to be counted in the >=60 and < 65 category. I would be very grateful for any suggestions.
 
If you simply want to truncate any fractional parts from the age then use
Code:
   Int ([Resident Age])
rather than just [Resident Age]
 
The Int function always rounds down (Int(64.7) = 64)...so that may be good enough to solve your problem. Hope that helps.

Kevin
 
Thanks to both of you. Your suggestion solved my problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top