Jump to content

This topic is 8010 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm using the age calculation:

NumToText(Year(Today) - Year(DOB) - If(Today<Date(Month(DOB),Day(DOB),Year(Today)), 1, 0))&"Years,"&NumToText(Mod(Month(Today) - Month(DOB) + 12 - If(Day(Today) < Day(DOB), 1, 0), 12))&"Month,"&NumToText(Day(Today) - Day(DOB) + If(Day(Today) >=Day(DOB), 0,If(Day(Today- Day(Today)) < Day(DOB),Day(DOB),Day(Today- Day(Today)))))&"Days"

I copied it from a post I found searching here on the boards. First of all, I'm getting the wrong result. From the birthdate '4/15/1973' I'm getting '2003years,2months,27days'. Not only that, but it's not different for every record, it uses the same result for every record in my client file. WTF??? I have the calculation using the 'DOB' date field. Could I be having problems because the dates are entered in MM/DD/YYYY format???

Posted

'2003years,2months,27days' is exactally today's date so..

DOB is empty because it is not a date field or 'cause it comes from relationship that is not activated.

DJ

Posted

Hi ddreese,

Using this format of the date 4/15/1973, the result using the calculation above is:

29Years,10Month,12Days

HTH

Lee

smile.gif

smile.gif

Posted

Use the Status(CurrentDate) function instead of the Today function and make the calculation unstored. This might not solve your current problem but it will fix the one you're going have sooner or later!

Todat only relaculates whenever the file is opened. If you host the file on a FM server or leave the file open more then 24 hours (or just across the mignight changeover) the calculation will be incorrect. It won't recalculate until you close and reopen the database.

Status(CurrentDate) has no such limitations.

This topic is 8010 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.