• WSStewart

    WSStewart

    @wsstewart

    Viewing 151 replies (of 151 total)
    Author
    Replies
    • in reply to: Query Criteria (97 SR2) #537477

      I use the statement
      endofweek(DateAdd(“d”,Date(),-7),7)
      as the criteria for the date field.

      endofweek is a function that returns the date representing the last day of the current week.

      Function EndOfWeek(D As Variant, Optional FirstWeekday As Integer) As Variant

      ‘ Returns the date representing the last day of the current week.

      ‘ Arguments:
      ‘ D = Date
      ‘ FirstWeekday = (Optional argument) Integer that represents the first
      ‘ day of the week (e.g., 1=Sun..7=Sat).

      If IsMissing(FirstWeekday) Then ‘Sunday is the assumed first day of week.
      EndOfWeek = D – WeekDay(D) + 7
      Else
      EndOfWeek = D – WeekDay(D, FirstWeekday) + 7
      End If
      End Function

    Viewing 151 replies (of 151 total)