Using select statement , we can display time or DateTime in different formats i.e using to_char
select to_char(sysdate,'HH:MI

S') FROM DUAL;
or
select to_char(sysdate,'HH.:MM.

S.') from dual;
if you have any validations as you mentioned like , regarding half hour etc, you need to extract Hour or Minute Or second by using functions and we need to display in required formats.
Quote:
Originally posted by richcta
I am trying to convert time currently in this format: HH24:MI to this format: HH24.MI. However there are some caveats.
Time is formatted HH24:MI. The MI will either be :30 or :00. If the time is on the half hour (:30) the time should read 20.5 for 20:30. If the time is 20:00 the time should read 20. I am still a beginner at SQL and looked through all of the online documentation I can but am still coming up short. Anyone got any suggestions?
|