Quote:
Originally Posted by tonkuma
Lenny,
Code:
when hour(current time) = 0
then char(current time + 12 hour) || ' AM'
would be never executed.
Because, there is a following description in the manual "DB2 SQL Reference".
And, the condition "hour(current time) = 0" is included in the first condition "hour(current time) < 12".
|
Thank you, tonkuma !
I could not understood what has to be wrong, and you find !
Also:
Code:
select char(current date, usa) || ' '
|| case
when hour(current time) = 0
then char(current time + 12 hour) || ' AM'
when hour(current time) < 12
then char(current time) || ' AM'
when hour(current time) = 12
then char(current time) || ' PM'
when hour(current time) > 12
then char(current time - 12 hour) || ' PM'
end as "AM/PM Timestamp"
from sysibm.sysdummy1
Lenny