July 20, 200421 yr Quick question: I have a calculation field set to calculate age: (TODAY - Current Date)/365.25 This works, but the field either rounds the age up or returns 32.99 years old or 18.24 years old, etc. How can I make this calculation field always round DOWN to the nearest full integer (no decimals or rounding up)? Shane
July 20, 200421 yr isn't Today dead in 7? and isn't Today and Current Date the same Date? I don't have 7, so this maybe easier. Here is the calculation I use in v6. (Year(ReferenceDate) - Year(Birthday) - If((ReferenceDate) < Date(Month(Birthday), Day(Birthday), Year(ReferenceDate)), 1,0))&" "&"Years,"&" "& Mod(Month(ReferenceDate) - Month(Birthday) + 12 - If((Day(ReferenceDate) < Day(Birthday)),1,0),12)&" "&" months,"&" "&"and " & Round(Mod(Day(ReferenceDate) - Day(Birthday) + 30.42+1 - If((Day(ReferenceDate) < Day(Birthday)),1,0),31),0) &" days." Text result. Lee
July 20, 200421 yr Author Sorry, I meant: (TODAY - Date of Birth)/365.25 "TODAY" does seem to work, at least for me, in 7. Shane
July 20, 200421 yr Newbies If you just want to see the years, this might work: Truncate( (Status(CurrentDate)-birthday)/365.25, 0). Use status (currentdate) not today() and make the field unstored if you can. Hope this helps
July 20, 200421 yr The Floor function may be what you're looking for in version 7. Here's a tweaked version of Lee's calc, combining the text that need not be separated, simplifying the already booleanized Ifs, and changing commas to semicolons for version 7, if this suits your needs... Year(ReferenceDate) - Year(Birthday) - (ReferenceDate < Date(Month(Birthday); Day(Birthday); Year(ReferenceDate))) & " Years, " & Mod(Month(ReferenceDate) - Month(Birthday) + 12 - (Day(ReferenceDate) < Day(Birthday)); 12) & " months, and " & Round(Mod(Day(ReferenceDate) - Day(Birthday) + 30.42 + 1 - (Day(ReferenceDate) < Day(Birthday)); 31); 0) & " days"
July 20, 200421 yr Author Thank you Lee and Queue, I justed needed the year only, so I modified and deleted the portion not needed. Also, Lee, I was wrong, I had TODAY listed as a field in my table referenced to the CurrentDate. Sorry. Shane
Create an account or sign in to comment