Results 1 to 10 of 10
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Negative number of days... (2000)

    I want to calutae days from 2 dates but have negative number....
    have (part of code):
    ...
    dim TEST_GG as long
    dim SCAD as date
    dim SITUAZ as date

    SCAD=28/02/2008
    SITUAZ =31/03/2008
    ....
    TEST_GG = SCAD - SITUAZ
    ....

    have TEST_GG = -32(!!!!)

    i want 32

  2. #2
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Negative number of days... (2000)

    TEST_GG = SITUAZ - SCAD

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Negative number of days... (2000)

    SITUAZ= 31/03/2008
    SCAD=30/06/2008

    TEST_GG = SITUAZ - SCAD

    TEST_GG=-91
    (????)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Negative number of days... (2000)

    TEST_GG = ABS(SITUAZ - SCAD)

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Negative number of days... (2000)

    work!!!!!!!!!!!!!!!!!
    Sorry TonyE, but Hans is a "wizard", sure...
    Tks in other case to Tony for suggestion.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Negative number of days... (2000)

    Tony's reply was perfectly valid for the question that you originally asked. You hadn't made it clear that either date could be before the other one.

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Negative number of days... (2000)

    Sorry me...

    how to subtract 90 days from this and have the new value of SITUAZ=01/01/2008
    SITUAZ =31/03/2008

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Negative number of days... (2000)

    How would you subtract 90? Think!

  9. #9
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Negative number of days... (2000)

    subtract 90 days from SITUAZ filled with 31/03/2008

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Negative number of days... (2000)

    You should be able to work it out yourself. Subtracting 90 from SITUAZ can't be that difficult!

Posting Permissions

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