May 25, 2006 #1 user222 Technical User Joined Nov 11, 2005 Messages 5 Location GB trying to calculate DOB with no decimal place but its showing the decimal places. can anyone help? using =((Now())-([DOB]))/364
trying to calculate DOB with no decimal place but its showing the decimal places. can anyone help? using =((Now())-([DOB]))/364
May 25, 2006 #2 jkl0 Technical User Joined Oct 12, 2005 Messages 143 Location US Try this. =Int (((Now())-([DOB]))/364) Upvote 0 Downvote
May 25, 2006 #3 JerryKlmns IS-IT--Management Joined Feb 7, 2005 Messages 2,062 Location GR =DateDiff("yyyy", [DOB], Date) Upvote 0 Downvote
May 25, 2006 Thread starter #4 user222 Technical User Joined Nov 11, 2005 Messages 5 Location GB thanx for the help jk10 worked a treat! Upvote 0 Downvote
May 25, 2006 #5 JerryKlmns IS-IT--Management Joined Feb 7, 2005 Messages 2,062 Location GR How come you two, have 364 days in every year? DateDiff("d", "2006-01-01", "2007-01-01") = 365 DateDiff("d", "2004-01-01", "2005-01-01") = 366 Upvote 0 Downvote
How come you two, have 364 days in every year? DateDiff("d", "2006-01-01", "2007-01-01") = 365 DateDiff("d", "2004-01-01", "2005-01-01") = 366
May 25, 2006 #6 Golom Programmer Joined Sep 1, 2003 Messages 5,595 Location CA If you're trying to compute an age in years then you need something like Code: Age = DateDiff("yyyy", dd, Date) + _ ((Format(dd, "mmdd") > Format(Date, "mmdd"))) Something like Int((#05/25/2006# - #05/26/2000#) / 364) = 6 but the correct age is 5. [small]No! No! You're not thinking ... you're only being logical. - Neils Bohr[/small] Upvote 0 Downvote
If you're trying to compute an age in years then you need something like Code: Age = DateDiff("yyyy", dd, Date) + _ ((Format(dd, "mmdd") > Format(Date, "mmdd"))) Something like Int((#05/25/2006# - #05/26/2000#) / 364) = 6 but the correct age is 5. [small]No! No! You're not thinking ... you're only being logical. - Neils Bohr[/small]