Jscott Posted September 18, 2005 Posted September 18, 2005 I have two fields, Date of Birth and Age. The age is calculated by the date of birth with by calculation below: Year( Status(CurrentDate) ) - Year( V Birth Date ) - (( Month( Status(CurrentDate) ) + Day( Status(CurrentDate) ) / 100 ) < ( Month( V Birth Date ) + Day( V Birth Date ) / 100)) Here is the issue: If only the age is known, I want to be able to skip the Date of Birth and just enter the age. Currently the age filed is non modifiable because of the calculation. Any suggestions would help. Thanks
LaRetta Posted September 18, 2005 Posted September 18, 2005 You need an AgeEst (estimate) field (number), then adjust your calculation thus: If ( not V Birth Date , AgeEst , Year( Status(CurrentDate) ) - Year( V Birth Date ) - (( Month( Status(CurrentDate) ) + Day( Status(CurrentDate) ) / 100 ) < ( Month( V Birth Date ) + Day( V Birth Date ) / 100)) ) Keep in mind that their age will not keep updating (if based upon the age estimate field) as an unstored calculation will, and when Users see the Age calculation, they won't know whether it's a real age or an estimate. I suggest instead then that you plug in an estimate date into V Birth Date and have a simple checkbox of 'Estimate'. At least it will update each year. LaRetta
Jscott Posted September 18, 2005 Author Posted September 18, 2005 If the user does not know the DOB but has an estimate how can I get the age field to allow a modification? Thanks
LaRetta Posted September 18, 2005 Posted September 18, 2005 I'm suggesting they plug in a date of birth as if they know it but also click a checkbox called 'Estimate'. It won't matter what month/day they enter (maybe have them enter January 1) because it will be inaccurate anyway. But if they know the age, they can calculate the year. At least in this way the age will keep updating each year. Otherwise, when they plug in an age (and 3 years passes) how will you know WHEN that age was entered? It will be worthless information.
Søren Dyhr Posted September 18, 2005 Posted September 18, 2005 ( Month( Status(CurrentDate) ) + Day( Status(CurrentDate) ) / 100 ) < ( Month( V Birth Date ) + Day( V Birth Date ) / 100) This is overkill, since the dates are stored as intergers behind the screens is all it takes: Status(CurrentDate) < V Birth Date --sd
LaRetta Posted September 18, 2005 Posted September 18, 2005 Status(CurrentDate) < V Birth Date You're missing the point here, Soren. Your suggestion will always produce false because it includes the year. The calculation must be broken into Month, Day and Year. The boolean test at the end adjusts the calculation properly, depending upon whether the month/day (of the birth date) has passed within the current year. If you search this Forum for multiple discussions by Comment, -Queue-, CobaltSky and others, you will find this discussed repeatedly. LaRetta
Søren Dyhr Posted September 18, 2005 Posted September 18, 2005 Ah yes to ignore the year is the issue!! --sd
Jscott Posted September 19, 2005 Author Posted September 19, 2005 (edited) I do not care about what time will do to the data, just that if age is known but DOB is not, that the user can input the age in the same field V_Age that contains the calculation. The field does not allow me to modify it. That is what I am trying to get around. I do not want to create a new field that shows Est_DOB etc... Thanks Edited September 19, 2005 by Guest
Recommended Posts
This topic is 7346 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 accountSign in
Already have an account? Sign in here.
Sign In Now