Rynorem
Oct 1 2009, 07:45 AM
Here's what I've got.
In the Query field:
I need to calculate an age from the DOB (date of Birth) to a specified date (3/1/2010).
I've used DateDiff("yyyy",[DOB],DATE())+(Format([DOB],"mmdd")>Format(DATE(),"mmdd")) in the query and it gave me thier current age. But I need it from the future date of Mar. 01 2010 (3/1/2010). When I replaced the DATE() with 3/1/2010 it gave me a large negative number. Please help.
Jamie
debra_dixon
Oct 1 2009, 08:04 AM
Did you put # around the set future date?
Rynorem
Oct 1 2009, 08:33 AM
Yes with the same results---negative number
truittb
Oct 1 2009, 09:02 AM
This works for me
DateDiff("yyyy",[DOB],#3/1/2010#)+(Format([DOB],"mmdd")>Format(#3/1/2010#,"mmdd"))
The only way I could get a negative number was to leave off the # delimiters.
You might check the date in DOB if it still does not work.
akn_39
Oct 1 2009, 09:05 AM
Would this work for you:
Age() Function (Allen Browne) Tony N.
Rynorem
Oct 1 2009, 09:13 AM
Thanks, Truittb. I copy paste it into the field and it worked. I compared the two and couldn't find a difference but it work so thanks.
truittb
Oct 1 2009, 10:50 AM
You are welcome.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.