Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateDiff - Years 7

Status
Not open for further replies.

SBerthold

Programmer
Sep 20, 2002
1,014
DE
What is the fastest/easiest method in VB to accurately determine the number of years between two dates?

I noticed that there seems to be an error in the DateDiff function because if the first date is 12/31/2001 and the second date is 1/1/2002, the datediff return 1 year, even though actual time passed is only 1 day!

Doing a search in this forum on datediff brings up too many results - if someone could please supply me an answer here or point me to a good link in this forum.
 
There was a good explanation (by CClint) that you may find relatated in a tread I posted a short while ago called "Dynamic Age Calc" (Sorry I've not worked out how to short cut to the thread yet).
 
thread222-501875 If somethings hard to do, its not worth doing - Homer Simpson
 
ChrisyH
Just type in the thread number exactly as it appears at the top of the thread, so this thread is thread222-368305. You can do the same for FAQs etc eg faq222-2244. The site automatically adds the highlight colour and the underline and makes it a link
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top