Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Populate variables with prior month's dates.

    Hello!

    I am looking for a simple function that will create variables containing the previous month’s dates.
    The case scenario:

    User selects a month (ACCTMM) and year (ACCTYY) from two dropdowns on an .asp page. I need the function to calculate/subtract from the selection and return three variables containing the three prior months. I plan on having the function run onSubmit.

    Example:
    If user selects 03 & 2006, I need
    ACCTYY1 = 2006 & ACCTMM1 = 02
    ACCTYY2 = 2006 & ACCTMM2 = 01
    ACCTYY3 = 2005 & ACCTMM3 = 12

    I am having a very difficult time figuring out how to create this so that it will take into account only 12 months and will go back to the correct year when a prior month variable needed is ’before’ January.

    I am still a novice coder, thank you in advance for your help!


  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    what do u mean by :"containing the three prior months."?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm looking to populate 6 hidden variables that I will be passing on to another page:

    ACCTYY1, ACCTMM1 (one month before dropdown choices)
    ACCTYY2, ACCTMM2 (two months before dropdown choices)
    ACCTYY3, ACCTMM3 (three months before dropdown choices)

    Drop down choices are:
    ACCTYY (four digits, any year)
    ACCTMM (two digits, 01 thru 12)

    Thanks


  •  

    Posting Permissions

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