- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
how to change a series of numbers into time format
Hello!
Can anybody help changing a series of numbers into time format [hh:mm:ss] here.
Originally, the data type is character. So, I've tried changing the data type from character to numeric to set format as [hh:mm:ss] but I failed...
I have no idea what to do now.
What I'd like to see as a result is, taking an example of 000003, 00:00:03..
It should not be that difficult, but I can't find a way...
And here's the data I'm dealing with now.
[column1] Original Date => [column2] After changing data type from character to numeric ==> [column3] After setting time format
Thank you in advance
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: how to change a series of numbers into time format
If I understand the "original" format correctly, one option would be to first convert first column to seconds by using formula like:
Num(Left(:Column 1, 2))*60*60 + Num(Substr(Column 1, 3, 2))*60 + Num(Right(Column 1,2));
and then convert that to duration format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: how to change a series of numbers into time format
If I understand the "original" format correctly, one option would be to first convert first column to seconds by using formula like:
Num(Left(:Column 1, 2))*60*60 + Num(Substr(Column 1, 3, 2))*60 + Num(Right(Column 1,2));
and then convert that to duration format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: how to change a series of numbers into time format
Another possibility is using informat:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: how to change a series of numbers into time format
This totally solved the issue.
Thank you a lot!