>From: sinues@prcd.prc.mrms.navy.mil (John Sinues)
>Subject: Cannot format date in R4GL
>Date: 12 Sep 1994 15:50:23 -0500
>X-Informix-List-Id: <news.8630>
>Simple question....why isn't the date not formatted in my report?
> LET p_date = DATE USING "mm/dd/yy"
> PRINT "Date: ", p_date,
>If I have the line
> LET p_date = DATE USING "mm/dd/yy"
>I get "mm/dd/yy" printed as the date in my report.
>If I remove the 'USING' clause, everything works ok.
>I am running Informix r4gl v4.11.UC2...any ideas?
Your fundamental problem is that you are trying to use DATE for the wrong
task -- you should be using TODAY.
DATE is a peculiar function. It has two forms: DATE unqualified returns an
American-format date string (Sep 13, 1994); DATE with an argument in
parentheses converts the argument into a DATE value. Your use should
approximate to the first, but the result of formatting a string with a
USING clause is at best ill-defined, and I think undefined. One plausible
interpretation of "xyz" USING "pqr" is "pqr", and I think that is what you
are getting.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>