×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Time field to a Char Field and make it Military Time

Time field to a Char Field and make it Military Time

Time field to a Char Field and make it Military Time

(OP)
I have a Time field (i.e. 11:23:15.000000PM) and I need to change it to Military time and to a Char field.

Help is appreciated.

Thanks

RE: Time field to a Char Field and make it Military Time

hi,

CODE

To_Char([Time field],'HH24:MI') 

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Time field to a Char Field and make it Military Time

(OP)
I'm getting an error " Message=ORA-01722: invalid number." I'm using a query manager tool and I just noticed when I view the statement for that time field that it is using some functions already that I can't change so it looks like the following in the statement:

The functions it is already using that I can't change "TO_CHAR(CAST((time field) AS TIMESTAMP),'HH24.MI.SS.FF')" is giving me the 11:23:15.000000PM output.

Thanks

RE: Time field to a Char Field and make it Military Time

So you have no access to time field?

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Time field to a Char Field and make it Military Time

(OP)
I can create an expression but I can't change any part of "TO_CHAR(CAST((time field) AS TIMESTAMP),'HH24.MI.SS.FF')".

Thanks

RE: Time field to a Char Field and make it Military Time

(OP)
I got it working "TO_CHAR(TO_DATE(SUBSTR(time field,1,8),'HH24.MI.SS'),'HH24:MI:SS'). Thanks

RE: Time field to a Char Field and make it Military Time

Kernal,

Out of curiosity, could you please post the field description for TIME?

Thanks,

santaMufasa
(aka Dave of Sandy, Utah, USA)
“People may forget what you say, but they will never forget how you made them feel."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close