Results 1 to 3 of 3

Thread: Calculate the date range of the last Complete 6 months.

  1. #1

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330
    Hi,
    I've been working on this for hours and can't come up with the proper code.
    I need to calculate the date range for the last complete 6 months in either yyyymmdd or yymm format. e.g. 19990901 to 20000229 or simply 9909 to 0002.
    I've tried the year with the month function but get 99 9 instead of 9909.
    Any assistance will be greatly appreciated.
    Thanks,
    Al.

  2. #2

  3. #3

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330
    Hi,
    I didn't have any code. I was working in the Immediate window simply trying to get the date ranges to print. I was also using the Format function.
    But since my post I found the DateAdd function which I didn't know about. I think it will serve my purposes.

    Print format(DateAdd("m",-6,date),"yymm")
    Print format(DateAdd("m",-1,date),"yymm")

    Thanks,
    Al.


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