JDE Time

4 posts / 0 new
Last post
VITOPIEPOLI
Offline
Joined: 10/29/2019 - 11:28
JDE Time

Hi I have a JDE 6 digits time field li 183005. It should be 18:30:05.
Is there a function to convert it?

Thanks

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57
Is this a text or numeric field? If it is numeric turn it into a string then you can use the @left, @mid and @right to extract the time, so something like this should work:

@left(@Str(183005, 6, 0), 2) + ":" + @mid(@Str(183005, 6, 0), 3, 2) + ":" + @right(@Str(183005, 6, 0), 2)

I think that should work but I haven't actually tested it so it might need a bit of an adjustment.
VITOPIEPOLI
Offline
Joined: 10/29/2019 - 11:28

Thank you very much Brian,
it needed to be wrapped within @Ctot function to work.
@Ctot(@Left(@Str(TIME_UPDATED,6,0),2) + ":"+ @Mid(@Str(TIME_UPDATED,6,0),3,2)+":"+@Right(@Str(TIME_UPDATED,6,0),2),"HH:MM:SS")

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57
Yes, that is true as this will give you a string and not a time field.