DATEDIFF Challenge - a real year.

Results 1 to 2 of 2

Thread: DATEDIFF Challenge - a real year.

  1. #1
    Join Date
    Dec 1969

    Default DATEDIFF Challenge - a real year.

    I did a datediff("yyyy".. to find the number of<BR>years between two dates. But this just calculates<BR>the difference in the years, and does not take into<BR>account the month or days.<BR><BR>I guess I could do a Day difference, then divide<BR>by 365. But what about the leap years, or the years<BR>that don&#039t have exactly 365 days.<BR><BR>Anyone know how to do this?

  2. #2 Guest

    Default RE: DATEDIFF Challenge - a real year.

    Look at the reference:<BR><BR><BR><BR>Notice that you can get the different intervals by specifying different parameters.<BR><BR>To get the days between two dates:<BR><BR>DateDiff("d", date1, date2)<BR><BR>To get the months:<BR><BR>DateDiff("m", date1, date2)<BR><BR>Etc.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts