Calculate Weekdays in ASP

Discussion in 'ASP General' started by JP SIngh, Jul 13, 2004.

  1. JP SIngh

    JP SIngh Guest

    Hi All

    I need to calculate the number of working days between the two dates entered
    on an ASP page. I am not that great a coder in ASP and was wondering if
    someone can help.

    Basically the form has Two textboxes to enter dates

    From Date - Fdate
    To Date - TDate
    Number of days - NoDays (This field needs to be populated by the function
    once the function/sub has been executed)

    The function should be able to calculate number of working days between the
    two dates but MUST exclude the list of public holidays between the two days.
    The list of public holidys for each year is stored in a database table.

    The form I am using also has two check boxes called

    Include Saturdays
    Include Sundays

    If any of the two checkboxes are checked it must include the relevant days
    in the calculation if not then sat/sun must be excluded from the
    calculation.

    Thanks in advance for your help it is highly appreciated
     
    JP SIngh, Jul 13, 2004
    #1
    1. Advertising

  2. JP SIngh

    Evertjan. Guest

    Evertjan., Jul 13, 2004
    #2
    1. Advertising

  3. Since VBScript has absolutely no concept of your company's holidays, you
    might be better off using a calendar table.

    http://www.aspfaq.com/2453
    http://www.aspfaq.com/2519

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "JP SIngh" <> wrote in message
    news:u$...
    > Hi All
    >
    > I need to calculate the number of working days between the two dates

    entered
    > on an ASP page. I am not that great a coder in ASP and was wondering if
    > someone can help.
    >
    > Basically the form has Two textboxes to enter dates
    >
    > From Date - Fdate
    > To Date - TDate
    > Number of days - NoDays (This field needs to be populated by the function
    > once the function/sub has been executed)
    >
    > The function should be able to calculate number of working days between

    the
    > two dates but MUST exclude the list of public holidays between the two

    days.
    > The list of public holidys for each year is stored in a database table.
    >
    > The form I am using also has two check boxes called
    >
    > Include Saturdays
    > Include Sundays
    >
    > If any of the two checkboxes are checked it must include the relevant days
    > in the calculation if not then sat/sun must be excluded from the
    > calculation.
    >
    > Thanks in advance for your help it is highly appreciated
    >
    >
     
    Aaron [SQL Server MVP], Jul 13, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marlon
    Replies:
    1
    Views:
    2,216
    Tom Kaminski [MVP]
    Sep 10, 2004
  2. Mike

    calculate weekdays

    Mike, Jul 11, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    353
  3. Jive Dadson

    weekdays in range

    Jive Dadson, Oct 18, 2009, in forum: Python
    Replies:
    4
    Views:
    326
    Jive Dadson
    Oct 18, 2009
  4. SimonC
    Replies:
    5
    Views:
    375
    Dr John Stockton
    Jan 27, 2005
  5. Robert de Ridder
    Replies:
    1
    Views:
    98
Loading...

Share This Page