Date Format

anandknr

Member
Please find below code .

DEFINE VARIABLE ddate AS DATE NO-UNDO FORMAT "99/99/9999" INIT 01/01/2001 .

MESSAGE ddate VIEW-AS ALERT-BOX .



The above program alerts as 01/01/01 instead of 01/01/2001 even after i had used format option. Please help to alert it in DD/MM/YYYY without changing it's data type that is string(ddate,"99/99/9999") will solve my issue , but that is not what i supposed to do ....

Sorry if it is a simple question . . .
 

Mohan.itti

New Member
Hi

Try this below code. it is give youe exasct output.

DEFINE VARIABLE ddate AS DATE NO-UNDO INIT 01/01/2001 .

MESSAGE day(ddate)"/"MONTH(ddate)"/"YEAR(ddate) VIEW-AS ALERT-BOX .

Regards
S.Mohanraj
ITTI Ltd
Bangalore
 

Cringer

ProgressTalk.com Moderator
Staff member
For that he might as well use the string(ddate,"99/99/9999") he stated above, but it won't solve his problem apparently.
 

tamhas

ProgressTalk.com Sponsor
I was going to say that you should always put the format on the display definition, not the variable, but I think your problem here is the use of MESSAGE instead of DISPLAY.
 
Top