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: Robert Sample
Posted: Fri Oct 14, 2016 11:42 pm (GMT 5.5)

You are getting precisely what you told the computer you wanted:
Code:
SELECT CAST(VARCHAR_FORMAT(GREGORIAN_DATE,'MM/DD/YYYY') AS CHAR(10)),
 CAST('|' AS CHAR(1)),
 CAST(VARCHAR_FORMAT(GREGORIAN_DATE,'YYYY.MM.DD') AS CHAR(10)),
so you cannot say anything else is expected -- you didn't provide any code to use a previous date, so you won't get one.
_________________
TANSTAAFL

The first rule of code reuse is that the code needs to be worth re-using.

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth


Viewing all articles
Browse latest Browse all 8500

Trending Articles