I need to select data from database with a date that is one day back into the past but on working day. Is there a specific function for that ( Excel has got formula =Workday)?
I am downloading data from DB2 to excel with VBA instructions.
Here is the piece of code I use for calendar day.
strSQL = "SELECT *" strSQL = strSQL & " FROM PDB2I.DI_HIS_EXH_RAT_01" strSQL = strSQL & " WHERE CAR_DT = CURRENT DATE - 1 DAY"
Thanks in advance for any directions
where mydate = current date -
(case when dayofweek(current date) = 1 then 2 -- sonntag
when dayofweek(current date) = 2 then 3 -- montag
else 1 end) days
Check what day of the week it is and change accordingly
select * from table_x where timestamp_x > (select PREV_WEEKDAY from(select sysdate as current_date,
case when to_char(sysdate,'D') in (1,2,7)
else sysdate-1 end as prev_weekday