SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Oct 2001
    Posts
    128
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting business date

    Hi,

    I need to get a date from past or future in terms of a business day(M - F). I am trying to work out a logic, but seem lost. The AddDateTime() function adds/deducts the # of days. I need to go further & get the business date closest to it. If anyone has a function to do the same, it will be of great help.

    Thanks.

    ------------------
    quality - a way of life!
    quality - a way of life!

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting business date

    This site seems to offer a reasonably direct solution:
    http://home.capecod.net/~pbaum/date/date0.htm

    Note: You can find quite a few more sites like this using www.google.com with search strings like:

    "day of week" functions

    "business date" algorithms

    "calendar functions" "business date"

    Like so many facts this one gets slippery if you have to factor in holidays.


    John



    ------------------

  3. #3
    Junior Member
    Join Date
    Nov 2004
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting business date

    The Page doesnt exist??

  4. #4
    Member
    Join Date
    Jun 2001
    Location
    Bedford, MA, USA
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting business date

    I had to do the same thing a few years ago. Fortunately I never throw away any code.
    Here you go:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">BOOLEAN IsWeekDay(DATETIME dtDate)
    //************************************************** *******************************
    // Returns TRUE if the supplied date is NOT on a weekend.
    // (i.e. Monday thru Friday = TRUE)
    //************************************************** *******************************
    BOOLEAN bWeekDay
    STRING sDay

    sDay = FormatDateTime(dtDate ,&quot;ddd&quot // get the supplied date as a DayOfWeek

    if MatchStr(&quot;SAT*&quot;,sDay) &#0124;&#0124; MatchStr(&quot;SUN*&quot;,sDay) // is it a weekend?
    bWeekDay = FALSE
    else // NOT a weekend
    bWeekDay = TRUE

    return bWeekDay</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Lemme know if this is what you need.
    - Jim

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:15 AM.

Copyright BetaSoft Inc.