Bapak Posted August 12, 2007 Posted August 12, 2007 I have dob and age fields and I wish to calculate age (in number of years... How?
Genx Posted August 12, 2007 Posted August 12, 2007 Umm... these should give you fairly accurate estimates to within a day. http://www.briandunning.com/cf/521 http://www.briandunning.com/cf/79 This will have to be unstored. You can also search on this site for similar requests should you want more info -- there are literally hundreds of posts.
comment Posted August 12, 2007 Posted August 12, 2007 Why estimate when it can be calculated, simply and accurately: http://www.fmforums.com/forum/showtopic.php?tid/150087/
Bapak Posted August 13, 2007 Author Posted August 13, 2007 Thanks, Genx... http://www.briandunning.com/cf/521 worked just great.
Genx Posted August 13, 2007 Posted August 13, 2007 (edited) I don't know, Michael, can't be bothered reading all the posts - The one below should give the accurate age though (logic eludes me more often than it should). Bapak: No code lol Edited August 13, 2007 by Guest
LaRetta Posted August 13, 2007 Posted August 13, 2007 What is the DayOfYear on 3/1/2004? How about 3/1/2005?
Genx Posted August 13, 2007 Posted August 13, 2007 (edited) Woops... Code Moded Edited August 13, 2007 by Guest
LaRetta Posted August 13, 2007 Posted August 13, 2007 An accurate calc (actually a few of them) was presented in the link Comment referred to which is why he presented it. And you're not the only one who has misinterpreted DayOfWeek, Alex. It LOOKS good, but will break if one of the dates is a leap-year year and the other isn't. :wink2:
Genx Posted August 13, 2007 Posted August 13, 2007 (edited) Okay, I give up, I can't think on 5 hours sleep sigh. I guess the only way to do it is with a direct month / day comparison which is boring. No seriously i quit. I don't get what's wrong with me this morning, the logic bit of my brain must have died overnight or something. Not one of the five calc's i've written this morning get the desired results, argh, argh, argh. Edited August 13, 2007 by Guest
LaRetta Posted August 13, 2007 Posted August 13, 2007 (edited) Well now you've worn me out, even though your syntax breaks. It'll look like I'm picking on you. Why you keep trying to reinvent the wheel is beyond me; particularly on 5 hours sleep when you aren't even testing your work ... If current date is 1/14/2007 and DOB is 12/14/2004, it says the person is 3 years old. Good night. Your calc is gone! Ha ha! I know what those kinds of days feel like! :giggle: Edited August 13, 2007 by Guest
LaRetta Posted August 13, 2007 Posted August 13, 2007 Hey there ... if I had a penny for each mistake I made or little thing I didn't test ... Sleep well, Alex. :waytogo:
Genx Posted August 13, 2007 Posted August 13, 2007 Lol!! I thought you were going to sleep, its morning here, I'm off to uni to "learn" hehe.
Recommended Posts
This topic is 6373 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