Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function NextNDay(ByVal pDay As Date, wday As Integer)
'*****************************************************
'Purpose: Returns the next n day
' (Sunday: 1 through Saturday: 7)
'Author: raskew
'Inputs: ? nextNDay(#10/22/02#, 6)
'Output: 10/25/02 - The next Friday(6)
' following the inputted (pDay) date.
'*****************************************************
NextNDay = [pDay] - WeekDay([pDay]) + wday + IIf(WeekDay([pDay]) >= wday, 7, 0)
End Function
Function LastNDay(ByVal pDay As Date, wday As Integer)
'*****************************************************
'Purpose: Returns the previous n day
' (Sunday: 1 through Saturday: 7)
'Author: raskew
'Inputs: ? lastNDay(#10/22/02#, 1)
'Output: 10/20/02 The previous Sunday(1)
' to the inputted (pDay) date.
'*****************************************************
LastNDay = [pDay] - (WeekDay([pDay]) + IIf(WeekDay([pDay]) <= wday, 7, 0) - wday)
End Function
PARAMETERS [enter mm/dd/yy] DateTime;
SELECT Orders.OrderID, Orders.CustomerID, Orders.OrderDate, Orders.RequiredDate, Orders.ShippedDate, Format(lastnday([enter mm/dd/yy],1),"Long Date") AS startdte, Format(nextnday([enter mm/dd/yy],7),"Long Date") AS enddte
FROM Orders
WHERE (((Orders.OrderDate) Between lastnday([enter mm/dd/yy],1) And nextnday([enter mm/dd/yy],7))) OR (((Orders.RequiredDate) Between lastnday([enter mm/dd/yy],1) And nextnday([enter mm/dd/yy],7))) OR (((Orders.ShippedDate) Between lastnday([enter mm/dd/yy],1) And nextnday([enter mm/dd/yy],7)));