|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Help with DateAdd FunctionHello 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.Weekday), but I've tried it and it returns the same value as (DateInterval.Day). 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). 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.Day, DateInterval.DayOfYear, or DateInterval.Weekday. These are treated as equivalent because DayOfYear and Weekday are not meaningful time intervals." Kerry Moorman Show quoteHide quote "rob" wrote: > 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.Weekday), but I've tried it and it returns the same value as > (DateInterval.Day). > > 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). > > > > I have to ask the "obvious" question: then why have different functions if
date and weekday are equivelant? Show quoteHide quote "Kerry Moorman" <KerryMoor***@discussions.microsoft.com> wrote in message news:66863939-86FE-4C16-B89D-20A12479AA1B@microsoft.com... > 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.Day, > DateInterval.DayOfYear, or DateInterval.Weekday. These are treated as > equivalent because DayOfYear and Weekday are not meaningful time > intervals." > > Kerry Moorman > > > > > > "rob" wrote: > >> 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.Weekday), but I've tried it and it returns the same value as >> (DateInterval.Day). >> >> 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). >> >> >> >> |
|||||||||||||||||||||||