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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datediff help?

Status
Not open for further replies.

tamethetikbalang

Programmer
Joined
Aug 24, 2003
Messages
34
Location
PH
for example we have to dates. 12/13/2002 and date today. How do you compute the difference in terms of year?
if I use this code <%= DateDiff(&quot;yyyy&quot;, Date, &quot;12/13/2002&quot;) %> the result is 1 but what I want is it will only count 1 if date today is exactly 12/13/2003. in this case the result I want is zero. thank you.
 
Try to use DateDiff using days and then compare with the days for 1 year +1 day if it's leap year

________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top