Focal Point
[SOLVED] Convert time portion of DateTime field to alphanumeric HHMMSS format

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8547028326

September 05, 2012, 12:15 AM
TMoorthy
[SOLVED] Convert time portion of DateTime field to alphanumeric HHMMSS format
Hello,

I am looking for some help on how to convert the time portion of a DateTime field to alphanumeric format of HHMMSS. I am currently using the HCNVRT function to extract the time from the DateTime field. This returns the time in HH:MM:SS format

e.g. HCNVRT( RecordDateTime , '(HHIS)' , 8 , 'A8' )
returns 17:23:32

However, I would like to strip out the colon characters, and return HHMMSS instead.
e.g. 172332

Any help on this would be greatly appreciated.

Thanks!

This message has been edited. Last edited by: Kerry,
September 05, 2012, 12:28 AM
Waz
Welcome to the forum....



Why not just EDIT the result.

e.g.
EDIT(HCNVRT( RecordDateTime , '(HHIS)' , 8 , 'A8' ),'99$99$99')


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

September 05, 2012, 11:30 AM
Dan Satchell
Function HPART or function HNAME may also work.


WebFOCUS 7.7.05
September 05, 2012, 12:38 PM
TMoorthy
Thanks Waz! That worked perfectly! I kept thinking in terms of date functions, it never occurred to me to use EDIT.

Thanks again!