Daily Query report

n90

Registered User.
Local time
Today, 04:34
Joined
Dec 6, 2013
Messages
18
Hey guys, I'm trying to run a report that I need to run every morning for the jobs opened the day before, However I would it to also give me Fridays/Sat/Sundays Open jobs when I run Monday. While running the report Tuesday-Friday it will only give me the day before jobs.
 
I've got one that goes the opposite direction (I need Monday after Friday), but it should get you started....
Code:
        If Format(now(), "dddd") = "Friday" Then 'shift to Monday, not Saturday!
            Me.txtInspDate = Int(now()) + 3
        Else
            Me.txtInspDate = Int(now()) + 1
        End If
You can also use vbMonday in some cases, but it's somewhat unreliable so I just hardcoded mine.
 
I've got one that goes the opposite direction (I need Monday after Friday), but it should get you started....
Code:
        If Format(now(), "dddd") = "Friday" Then 'shift to Monday, not Saturday!
            Me.txtInspDate = Int(now()) + 3
        Else
            Me.txtInspDate = Int(now()) + 1
        End If
You can also use vbMonday in some cases, but it's somewhat unreliable so I just hardcoded mine.

I'm not exactly sure how to add this to my Query, cause I just currently have 2 were one is set to filter via Date()-1 and the other Date()-3.
 
Change one of your query criteria to this:

>IIf(Weekday(Date())=1,Date()-3,Date()-1)

I uploaded a sample.
 

Attachments

Users who are viewing this thread

Back
Top Bottom