0
Guys I’m having a hard time transcribing this sql server structure to IMB DB2. Could someone help me.
with cte as
(
select
CASE
WHEN CONVERT(datetime, format( getdate(), 'HH:MM') ) BETWEEN '06:00' AND '11:59' then 1
WHEN CONVERT(datetime, format( getdate(), 'HH:MM') ) BETWEEN '12:00' AND '16:59' then 2
WHEN CONVERT(datetime, format( getdate(), 'HH:MM') ) BETWEEN '17:00' AND '23:59' then 3
WHEN CONVERT(datetime, format( getdate(), 'HH:MM') ) BETWEEN '00:00' AND '05:59' then 4
END AS regra_job
)
select * from cte
Could simplify to
EXTRACT(HOUR FROM CURRENT_TIMESTAMP) BETWEEN 6 AND 11
and so on.– anonimo
I wonder if anyone has any function ready that for ibm db2
– Cristiano Gonçalves
Try
EXTRACT(HOUR FROM CURRENT TIMESTAMP) BETWEEN 6 AND 11
. Refer to the manual.– anonimo
I’ll try and tell you.
– Cristiano Gonçalves