× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks Charles. That worked perfectly. I used the time data type.

Raul, %editw only works in RPG and I needed an SQL solution. Thanks anyway.

On 9/25/2020 12:22 PM, Charles Wilt wrote:
9B? Wow...

Do you want to convert it to an actual time data type, or a string?

Time would be my recommendation...
select
time(timestamp_format(right(digits(int(200))
,4)
,'HH24:MI'))
from sysibm.sysdummy1

If you really want a string, throw a VARCHAR_FORMAT in there instead of TIME
select
varchar_format(
timestamp_format(right(digits(int(200))
,4)
,'HH24:MI')
,'HH24:MI')
from sysibm.sysdummy1

Charles




On Fri, Sep 25, 2020 at 9:38 AM Dean Eshleman<Dean.Eshleman-d3hNrR/acMxWk0Htik3J/w@xxxxxxxxxxxxxxxx>
wrote:

Hi,

I have a field in file defined as 9B 0 that represents a time in hours and
minutes. I want to display the value as HH:MM using SQL. I assume it
involves casting the value to a character. However, I can't figure out how
to keep a leading zero for a time like 02:00 that is in the file as 200.
Any ideas?

Dean Eshleman
Software Development Architect
Everence

1110 North Main Street
PO Box 483
Goshen, IN 46527
(800) 348-7468 ext. 3528
(574) 533-9515 ext. 3528
[Join our Talent Network]<http://www.everence.com/careers>


Confidentiality Notice: This information is intended only for the individual or entity named. If you are not the intended recipient, do not use or disclose this information. If you received this e-mail in error, please delete or otherwise destroy it and contact us at (800) 348-7468 so we can take steps to avoid such transmission errors in the future. Thank you.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.