Results 1 to 2 of 2

Thread: Nasty Date issue

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    78

    Post

    I've got a nasty one for you. . .
    I have a date issue where I have a received date (when goods come into door) and a floor date (When goods are available to be consumed on the production floor). The Floor date is nonexistent, and I need to calculate it.

    There's a set number of days (contained in another field, DelayTime) that is the delay between the two dates, and allows calculation of Floor Availability.

    The problem is that DelayTime is in business days, and no work is done on the weekend.

    So if I have a DelayTime of 3 business days, goods come in the door on Thurs, I need it to set the date to Tues, not Sun.

    Anyone have any nifty functions that calculate around weekends?


    ------------------
    Legalese:
    Anything I say on this forum is strictly my own opinion, and if I make a jerk out of myself, it has NOTHING to do with the company.

    [This message has been edited by JohnAtWork (edited 07-16-1999).]

  2. #2
    Junior Member
    Join Date
    Jun 1999
    Location
    Papillion, NE, USA
    Posts
    21

    Post

    Public Function CalcBusDays(StartDate as Date, NumOfDays as Integer) as Date

    Dim WorkDate as Date

    WorkDate = StartDate
    Do Until NumOfDays = 0

    Add_Next_Date:
    WorkDate = WorkDate + 1
    If WeekDay(WorkDate) < 2 or WeekDay(WorkDate) > 5 Then Goto Add_Next_date

    NumOfDays = NumOfDays - 1

    Loop

    CalcBusDays = WorkDate
    Exit Function

Posting Permissions

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



Click Here to Expand Forum to Full Width