× 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.



On 26-Mar-2015 11:31 -0500, Gary Thompson wrote:
iSeries at V7R1, about a year behind on PTF's

I'm using the TO_CHAR SQL function to output time-stamp info in a
'user-friendly' format.

In one document I found discussing this function, I see the comment:
"AM is the default meridian indicator."

So-far, I've not been able to create a TO_CHAR format string on our
iSeries that returns a time with an AM/PM "indicator" - so I think I
need to use a CASE statement ?

What format-string was specified [and of course was expected to function as desired], and what were the unexpected results? Was perhaps the following string attempted, and with what results?:

TO_CHAR(myTimeStampColumn,'DD-Mon-YYYY HH24:MI AM')

Might the CHAR function suffice, using the value USA as the second argument for the TIME-value specified as the datetime-expression for the first argument, concatenated to the end of the VARCHAR_FORMAT using a format-string that does not include the TIME portion [that fails to format properly], to serve as a circumvention pending resolution to the difficulty? Perhaps:

TO_CHAR(myTimeStampColumn,'Day DD Mon YYYY ')
concat CHAR(TIME(myTimeStampColumn), USA)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.