Wondering if anyone has written one, or can point me in the right direction, or an Analytics query to return rows of the last business day? I currently have the following (which may be wrong..)
SELECT
"Time Entry (Zoho Desk)"."Request" AS 'Ticket ID',
"Time Entry (Zoho Desk)"."Executed Time",
day_of_week("Time Entry (Zoho Desk)"."Executed Time") AS 'Day Number',
day_of_week(today()) AS 'Todays Day Number'
FROM "Time Entry (Zoho Desk)"
That would tell me the number of the weekday the time entry was executed, and bring back today's day number. Basically I'm looking for something along the lines of
If 'Todays Day Number' = 7, SELECT rows where 'Day Number' = 6 (covering Saturday)
If 'Todays Day Number' = 1, SELECT rows where 'Day Number' = 6 (covering Sunday)
Else SELECT rows where 'Day Number' = today() - 1