Do you need the time duration for the TIMESTAMPDIFF scalar function?
If so, the duration must be a Char(22) representation of the duration in the
format (-)YYYYMMDDHHMMSS,MSMSMSM, i.e
Cast(Timestamp1 - Timestamp2 as (Char(22)
Or in your case Cast(Time(Substr(flaend, 79, 8)) - Time(Substr(flastr, 81,
8)) as Char(22))
If you have a number of seconds or a numeric timeduration in format HHMMSS
and want to get a "formatted" time, you might convert it into a real time,
by adding the result to midnight:
Example: Cast('00.00.00' as Time) + YourNbrOfSeconds Seconds
If you have a numeric time duration, you may format the duration as DEC(8,
0) and just add the numeric value (without adding a duration name) to
midnight.
Example: Cast('00.00.00' as Time) + Cast(YourHHMMSS as Dec(8, 0)
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Steinmetz, Paul
Sent: Dienstag, 25. April 2017 23:33
To: 'Midrange Systems Technical Discussion' <midrange-l@xxxxxxxxxxxx>
Subject: Convert SQL time duration to character
I need to convert an SQL time duration to character.
(time(substr(flaend,79,8)) - time(substr(flastr,81,8)))
Which function should I use?
I took a look at CAST, no success as of yet.
Thank You
_____
Paul Steinmetz
IBM i Systems Administrator
Pencor Services, Inc.
462 Delaware Ave
Palmerton Pa 18071
610-826-9117 work
610-826-9188 fax
610-349-0913 cell
610-377-6012 home
psteinmetz@xxxxxxxxxx<mailto:psteinmetz@xxxxxxxxxx>
http://www.pencor.com/
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.