Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

DB2 :: RE: Get correct date and time when current time is over 12 hrs

$
0
0
Author: Rohit Umarjikar
Posted: Sat Oct 15, 2016 12:28 am (GMT 5.5)

That's right!!, How about this?
Code:
  select
  case when (current time  > '23:59:59' AND
             current time      <= '00:59:59') then
    VARCHAR_FORMAT(current date - 1 day,'MM/DD/YYYY')
  else VARCHAR_FORMAT(current date,'MM/DD/YYYY')  end 
     from sysibm.sysdummy1

_________________
Regards,
Rohit Umarjikar
"Knowledge is knowing that a tomato is a fruit, but Wisdom is knowing not to put it in a fruit salad."icon_razz.gif


Viewing all articles
Browse latest Browse all 8500

Trending Articles