May 25, 2006 #1 user222 Technical User Nov 11, 2005 5 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 Oct 12, 2005 143 US Try this. =Int (((Now())-([DOB]))/364) Upvote 0 Downvote
May 25, 2006 #3 JerryKlmns IS-IT--Management Feb 7, 2005 2,062 GR =DateDiff("yyyy", [DOB], Date) Upvote 0 Downvote
May 25, 2006 Thread starter #4 user222 Technical User Nov 11, 2005 5 GB thanx for the help jk10 worked a treat! Upvote 0 Downvote
May 25, 2006 #5 JerryKlmns IS-IT--Management Feb 7, 2005 2,062 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 Sep 1, 2003 5,595 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]