Help with DateAdd Function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rob

    #1

    Help with DateAdd Function

    Hello all,

    I have a report that is always due 14 weekdays (Monday thru Friday) from the
    day it is suspensed.

    I would like to use the DateAdd function using the weekday interval (
    DateInterval.We ekday), but I've tried it and it returns the same value as
    (DateInterval.D ay).

    Am I doing something wrong, or do I have the wrong expection for this
    function?


    BTW - I already worked out a solution (using Select-Case and weekday
    function).



  • Kerry Moorman

    #2
    RE: Help with DateAdd Function

    rob,

    Based on this remark from the documentation, I would say that you have the
    wrong expectation for the function:

    "To add days to DateValue, you can use DateInterval.Da y,
    DateInterval.Da yOfYear, or DateInterval.We ekday. These are treated as
    equivalent because DayOfYear and Weekday are not meaningful time intervals."

    Kerry Moorman





    "rob" wrote:
    [color=blue]
    > Hello all,
    >
    > I have a report that is always due 14 weekdays (Monday thru Friday) from the
    > day it is suspensed.
    >
    > I would like to use the DateAdd function using the weekday interval (
    > DateInterval.We ekday), but I've tried it and it returns the same value as
    > (DateInterval.D ay).
    >
    > Am I doing something wrong, or do I have the wrong expection for this
    > function?
    >
    >
    > BTW - I already worked out a solution (using Select-Case and weekday
    > function).
    >
    >
    >
    >[/color]

    Comment

    • rob

      #3
      Re: Help with DateAdd Function

      I have to ask the "obvious" question: then why have different functions if
      date and weekday are equivelant?

      "Kerry Moorman" <KerryMoorman@d iscussions.micr osoft.com> wrote in message
      news:66863939-86FE-4C16-B89D-20A12479AA1B@mi crosoft.com...[color=blue]
      > rob,
      >
      > Based on this remark from the documentation, I would say that you have the
      > wrong expectation for the function:
      >
      > "To add days to DateValue, you can use DateInterval.Da y,
      > DateInterval.Da yOfYear, or DateInterval.We ekday. These are treated as
      > equivalent because DayOfYear and Weekday are not meaningful time
      > intervals."
      >
      > Kerry Moorman
      >
      >
      >
      >
      >
      > "rob" wrote:
      >[color=green]
      >> Hello all,
      >>
      >> I have a report that is always due 14 weekdays (Monday thru Friday) from
      >> the
      >> day it is suspensed.
      >>
      >> I would like to use the DateAdd function using the weekday interval (
      >> DateInterval.We ekday), but I've tried it and it returns the same value as
      >> (DateInterval.D ay).
      >>
      >> Am I doing something wrong, or do I have the wrong expection for this
      >> function?
      >>
      >>
      >> BTW - I already worked out a solution (using Select-Case and weekday
      >> function).
      >>
      >>
      >>
      >>[/color][/color]


      Comment

      Working...