db2 convert TIME to string 'HH24MISS'

db2 convert time to string
Hi I want to convert a time files (NOT Date, NOR timestamp) to a string representation with the format: 'HH24MISS'

I've tried:
1. TO_CHAR(mytime, 'HH24MISS')
2. VARCHAR_FORMAT(mytime, 'HH24MISS')
3. SUBSTR(LPAD(mytime, 6, '0'), 1, 2) ...

None of it worked
Many thanks for your support
mruffAsked:
Who is Participating?
 
Kent OlsenData Warehouse Architect / DBACommented:
Well, in UDB this works just fine:

  replace (cast (mytime as varchar(10)), ':', '')
0
 
dfkeCommented:
Hi,

What is it that you mean by 'a time files'. Can you be more specific?

Cheers
0
 
mruffAuthor Commented:
Sorry typo:
A db2 database field of type TIME
0
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi mruff,

What version of DB2 are you running?  And what's the underlying server?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.