Hi, I wanted to say that I love this function. It's great. However, I have done this and for some reason, it's calculating incorrectly??? It is behind by two months. I checked my time/date setting on the lower left hand side of the computer and it is correct. Is there another area that I need to adjust this so it is correct?
@Firchild i figured out why...its simply because the function finds the difference in years and disregards the months. one month ago, so im prob a bit late.
@tmkm130 I had a similar issue with the year being off by one. I found this DateDiff("yyyy",[DOB],Now())+Int(Format(Now(),"mmdd")<Format([DOB],"mmdd")) and it works for me. Firchild is still the pro though I just got lucky.
do you not have a problem with the datediff function in that it is slightly incorrect. for example the number of years difference between 30-dec-2009 and 1-jan-2010 is 1??? i normally have to write a vba code to fix this.
Thank you worked fine for me =)
Legionari3 3 weeks ago
Thanks for the DateDiff tip. Do you know how to calculate age using DOB and specific date instead of now? thanks.
twelvedangs 1 month ago
Fair play. I love you. Your accent reminds me of my home town Swansea
zopydude 2 months ago
Beautiful! Just Beautiful!!!! Thank you for posting.
MyFriendsCallMeGreg 3 months ago
Appreciate this mate, I prefer to watch a YT vid of how to do something as opposed to reading a written tutorial :)
kaneforrester 5 months ago
nice
thank you
abadi1010 1 year ago
Thank you ^^
peterATIAMDlife 1 year ago
okay this may sound like an odd question but is there a way to do this for days instead of years?
annymfilliu 1 year ago
how do i do this in Access 2010????????????
Targus19 1 year ago
@Targus19 Exactly as it is here.
Firchild 1 year ago
@Targus19 I dind't worked out for me in Access 2010, so i used semicolons(;) instead of commas(,). No idea why, but it worked for me!
fotobalk 1 year ago
@Targus19 2010 does the same things a the prior Office programs but has more abilities. So if it can be done here it can be done there the same way.
SGTZlakin 9 months ago
OMG YOU JUST SAVED MY LIFE!!! lol
CareyBeaufordPortnoy 1 year ago
Also, I was wondering if there is a way to calculate the difference between two fields that have dates? What is the formula for that? Thank you!!!
tmkm130 1 year ago
@tmkm130 replace now() with [the field name] and it should work
SGTZlakin 1 month ago
Hi, I wanted to say that I love this function. It's great. However, I have done this and for some reason, it's calculating incorrectly??? It is behind by two months. I checked my time/date setting on the lower left hand side of the computer and it is correct. Is there another area that I need to adjust this so it is correct?
tmkm130 1 year ago
@tmkm130 Hmmm. that's a funny one. Normally that would be a system clock issue. So I'm a bit at a loss there, sorry!
Firchild 1 year ago
@Firchild i figured out why...its simply because the function finds the difference in years and disregards the months. one month ago, so im prob a bit late.
Mettagon 1 year ago
@tmkm130 I had a similar issue with the year being off by one. I found this DateDiff("yyyy",[DOB],Now())+Int(Format(Now(),"mmdd")<Format([DOB],"mmdd")) and it works for me. Firchild is still the pro though I just got lucky.
SGTZlakin 1 month ago
However, doesn't work in czech short date format: dd.mm.yyyy
Still returns error like Invalid syntax.
kartovo 1 year ago
@kartovo Dunno, I'm not Czech
Firchild 1 year ago
Thanks, this was most helpful.
mitchrc3 1 year ago
Thanks for that =)
xOneShotOneKillx 1 year ago
great, thx for the help!!!!
jodesaunois 2 years ago
Thank you so much!!!
sonmezb 2 years ago
apart from calculating age what can date diff be used for ?
RiKKuXd28 2 years ago
You just saved my life...THANKS A TONNNNNNN
abhvor87700 2 years ago
thankyou your a life saver!
dannyweeks12345 2 years ago
do you not have a problem with the datediff function in that it is slightly incorrect. for example the number of years difference between 30-dec-2009 and 1-jan-2010 is 1??? i normally have to write a vba code to fix this.
andyv123 2 years ago
You could try DateDiff("yyyy", [Birthdate], Now())+ Int( Format(now(), "mmdd") < Format( [Birthdate], "mmdd") ) AS Age to work around that issue
prakus74 2 years ago
WOW!!!!!! ^__^
Metaljoxxx123456 2 years ago
you are GOD!!!!!
Metaljoxxx123456 2 years ago
Thanks a lot, very helpful.
crazeeguyJc 2 years ago
you are a legend mate this helped with an assignment
milloy5 2 years ago
Thank you.
davidjones1965 3 years ago
great help. Cheers
Kingmistry300 3 years ago