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



Vern,
I've not done a lot of searching, but Rob's reply looks like is should work for me.
Will be noon here in about 15, so I'll have my answer soon.
Oh, I think I can just hard-code the time-stamp and run in STRSQL . . .

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Vernon Hamberg
Sent: Thursday, March 26, 2015 11:32 AM
To: Midrange Systems Technical Discussion
Subject: Re: TO_CHAR function

Nice to know - and it requires 7.1 so far as I can tell - the 6.1 manual doesn't have AM or Mon or several other format string components.

On 3/26/2015 11:59 AM, CRPence wrote:
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)


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


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.