Results 1 to 6 of 6

Thread: Number of Months ago.

  1. #1

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Number of Months ago.

    Hi,
    I'm trying to create a function that will calculate the number of months between two dates.
    For example:
    Sept. 12, 2001 minus July 17, 2000 should yield 14.

    Any ideas?

    Thanks,
    Al.
    A computer is a tool, not a toy.

  2. #2
    Hyperactive Member beasty1711's Avatar
    Join Date
    Mar 2001
    Posts
    418
    if u use the datediff function

    myStr = datediff(interval$,date1,date2[,firstdayofweek [,firstweekofyear]])
    "...They even have the internet on computers..." :- Homer Simpson

    "Second Place is First Looser" :- No Fear

  3. #3
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Smile

    Or perhaps the built in DateAdd function is what you want to use ..... ??
    ~Peter


  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    VB Code:
    1. MsgBox DateDiff("m", #7/17/2000#, #9/12/2001#)

  5. #5
    Fanatic Member
    Join Date
    Jul 2001
    Location
    London UK
    Posts
    671
    VB Code:
    1. MsgBox DateDiff("m", #7/17/2000#, #9/12/2001#)

  6. #6

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Wow! That was quick.

    Thanks all.

    Al.
    A computer is a tool, not a toy.

Posting Permissions

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



Click Here to Expand Forum to Full Width