Kbase P130865: How do I display an open edge integer time field in EasyAsk in HH:MM:SS format?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/23/2008 |
|
Status: Unverified
GOAL:
How do I display an open edge integer time field in EasyAsk in HH:MM:SS format?
FACT(s) (Environment):
EasyAsk
FIX:
The following formulas can be used to format an open edge integer field called Begin Time into HH:MM:SS format:
customtime ceiling(((Begin Time + 1)/ 3600) - 1)
customseconds mod(Begin Time,3600)
custommin customseconds / 60.0
customhour ea_to character(ceiling(((Begin Time + 1)/ 3600) - 1))
customminutes ea_to character(custommin)
start time ifa((length(customminutes) = 1.0),concat(customhour,":0",customminutes),concat(customhour,":",customminutes))
This can be also done by creating a view for a table containing date + time (integer) field and referring to a view instead to a table in EA
since version 10 OpenEdge supports datetime field.
CREATE VIEW schema.sample_view(Sample_Field1, Sample_DateTime, Sample_Field2)
AS SELECT Sample_Field1, TO_TIMESTAMP(CONCAT( CONCAT(TO_CHAR(sample_date), ' ') ,
CONCAT( CONCAT( CONCAT( CONCAT( TO_CHAR( ((((sample_time - MOD(sample_time,60)) / 60) - (MOD(((sample_time - MOD(sample_time,60)) / 60), 60))) / 60) ) , ':' ) ,
LTRIM( TO_CHAR( MOD(((sample_time - MOD(sample_time,60)) / 60), 60) ) ) ) , ':' ) , LTRIM( TO_CHAR( MOD(sample_time,60) ) ) ) )) , Sample_Field2 FROM pub.mytable