You would think this to be a simple task in the ABL, but it isn't.
I have a DATETIME field that contains the DATE and TIME of an appointment.
I have a Browse (Grid actually) that shows all appointments on a certain day.
Since all of these appointments are on the same day and there are many fields to show, the requirement is to show only the time part.
Apparently the DATETIME display format does not allow for this.
So I thought extracting this information to a CHARACTER field for display purposes like this but
I cannot get that to work either. Any suggestions?
not pretty, but works ok ...
def var dt as datetime no-undo.
dt = now.
message string(interval(dt,datetime(date(dt)),"seconds"),"HH:MM:SS")
MESSAGE SUBSTRING(STRING(NOW),11,9)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
rohit.ramak wrote:
MESSAGE SUBSTRING(STRING(NOW),11,9)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
Works for me!
Beautiful in it's simplicity.
Thanks!
pffft. Who needs simples ?
Your example is future proof. The substring would be incorrect with a 5 digit year...