Results 1 to 3 of 3

Thread: Differentiating Dates... !?!

  1. #1

    Thread Starter
    Addicted Member cyberwarpy's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    200

    Question

    Ok, heres the problem:

    I have a database that requires two dates (two different fields), for e.g:

    Start Date (4/4/1983) to Stop Date (16/4/1983)

    How do I find how many *Weekend* days there were during these two dates...? If you could answer this, you must be a true GURU.

  2. #2
    Junior Member
    Join Date
    Nov 1999
    Location
    The Netherlands
    Posts
    26
    I would run a macro; in excel you have the function weekday:

    start = value(startdate)
    end = value(enddate)

    j = 0

    for i = start to end

    if weekday(i,1) = 6 or 7 then

    j = j + 1

    end if

    next

  3. #3
    Hyperactive Member
    Join Date
    Nov 2000
    Location
    Mexico City
    Posts
    306
    You have that function in visual basic too. If you need to access the data from a database, its better vb than excel.
    If things were easy, users might be programmers.

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