Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jul 2005
    Location
    North Carolina, USA
    Posts
    195
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Trying to create a query that can count the number of Fridays on a designated date range. Any help..

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    See the thread Counting [mon]days between two dates (2000). I posted a function CountDaysBetween that will do what you want.

  3. #3
    2 Star Lounger
    Join Date
    Jul 2005
    Location
    North Carolina, USA
    Posts
    195
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    See the thread Counting [mon]days between two dates (2000). I posted a function CountDaysBetween that will do what you want.
    Hey HansV, thanks for the code; by the way, I notice when I pasted the code in the module and this line "d = (EndDate - BegDate) 7" fonts is red; any idea?...

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I posted that code many years ago; the Lounge database has been converted at least three times since then, and apparently that line didn't survive intact. It should be

    d = (EndDate - BegDate) \ 7

    with a backslash \ before the 7. This is the "integer division" operator in VBA, for example 19 \ 7 = 2 because 7 goes 2 times into 19 (with remainder 5).

  5. #5
    2 Star Lounger
    Join Date
    Jul 2005
    Location
    North Carolina, USA
    Posts
    195
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by HansV View Post
    I posted that code many years ago; the Lounge database has been converted at least three times since then, and apparently that line didn't survive intact. It should be

    d = (EndDate - BegDate) \ 7

    with a backslash \ before the 7. This is the "integer division" operator in VBA, for example 19 \ 7 = 2 because 7 goes 2 times into 19 (with remainder 5).
    HansV, you're the greatest!!! thanks a million, once again..:0)

Posting Permissions

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