pegaga1979
5th March 2014, 10:31
Hi Experts,
may i know how i can separate time from 172013 to 17:20:13 using reports field?
Im using domain tc mcs.str6
tq.
bhushanchanda
5th March 2014, 11:38
Refer this thread! (http://www.baanboard.com/baanboard/showthread.php?t=61324)
bdittmar
5th March 2014, 13:57
Hi Experts,
may i know how i can separate time from 172013 to 17:20:13 using reports field?
Im using domain tc mcs.str6
tq.
Hello,
if i see it right, you have a string with domain tcmcs.str6 as HHMMSS
and want to have HH:MM:SS
Example: Domain tcmcs.str6 time
so use : domain tcmcs.str8 formatted.time
formatted.time = time(1;2)&":"&time(3;2)&":"&time(5;2)
will give HH:MM:SS
or use sprintf$ functionality
Regards
pegaga1979
7th March 2014, 08:16
Hi, but the domain is from the table.so i can't edit to tcmcs.str8.
may i know how to use sprintf$?am i need to write in print condition at Field layout?
günther
7th March 2014, 08:57
Hi pegaga.
I would like to suggest you a completely different approach. The basic idea is: if the time is stored in bcd (binaray coded decimal), you can simply use the format "99:99:99" to get it displayed/printed.
But baan normally stores a time as "seconds since midnight"; so how can we convert that into bcd?
detail.1:
before.layout:
domain tctime a
long h, m, s
a = time.num() | or a table field
h = a / 3600.0
m = (a \3600.0) / 60.0
ss= a \ 60.0
a = h*10000 + m * 100 + s
Btw.: I'm doing that often do display time fields on forms, too.
Regards, Günther