Date Conversion
Posted in 2001
Topics: Stored Procedures & SPL
Hi, I have a column and the datatype is DATE. The values are: 01/01/2001 01/16/2001 Now how can I display this date value into: 01-JAN-2001 16-JAN-2001 Thanks Sent via Deja.com http://www.deja.com/
mazafar4@my-deja.com wrote: > I have a column and the datatype is DATE. The values are: > 01/01/2001 > 01/16/2001 > > Now how can I display this date value into: > 01-JAN-2001 > 16-JAN-2001 Using which software? In ESQl/C, you'd use one of the date formatting routines with a format specifier of dd-mmm-yyyy and then run the result through upshift. In DB-Access, there isn't a way to do that; if you need precise control over the format, DB-Access isn't the tool to use. Well, you could experiment with DBTIME or GL_TIME, but you'd have to coerce the DATE to a DATETIME to get it to have any effect at all, and I have major reservations about those environment variables at all (related to the formatting of DATETIME YEAR TO SECOND, DATETIME YEAR TO DAY and DATETIME HOUR TO FRACTION(5) all being controlled by a single environment variable). -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"
I want to use thru dbaccess. If you have a ESQL/C program then it will
be very helpfull.
I am using Informix 8.3FC4 on HP-UX 11.0
Thanks
In article <3A660200.DC3DCFC8@informix.com>,
Jonathan Leffler <jleffler@informix.com> wrote:
> mazafar4@my-deja.com wrote:
> > I have a column and the datatype is DATE. The values are:
> > 01/01/2001
> > 01/16/2001
> >
> > Now how can I display this date value into:
> > 01-JAN-2001
> > 16-JAN-2001
>
> Using which software? In ESQl/C, you'd use one of the date formatting
> routines with a format specifier of dd-mmm-yyyy and then run the
result
> through upshift.
>
> In DB-Access, there isn't a way to do that; if you need precise
control
> over the format, DB-Access isn't the tool to use. Well, you could
> experiment with DBTIME or GL_TIME, but you'd have to coerce the DATE
to
> a DATETIME to get it to have any effect at all, and I have major
> reservations about those environment variables at all (related to the
> formatting of DATETIME YEAR TO SECOND, DATETIME YEAR TO DAY and
DATETIME
> HOUR TO FRACTION(5) all being controlled by a single environment
> variable).
>
> --
> Yours,
> Jonathan Leffler (Jonathan.Leffler@Informix.com) #include
<disclaimer.h>
> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
> "I don't suffer from insanity; I enjoy every minute of it!"
>
Sent via Deja.com
http://www.deja.com/