I have a date field defined in my D spec set to the run date
by setting the dte thus:-
TodaysDate = %Date();
I then extract each date element into a character string
using this command:-
H2LDATE = %Char(%Subdt(TodaysDate:*YEARS))
+ %Char(%Subdt(TodaysDate:*MONTHS))
+ %Char(%Subdt(TodaysDate:*DAYS));
The problem is that instead of '20040517', I get
'2004517 '.
Leading zeroes are dropped instead of represented by '0'.
Whats the best way to get round this?
Dazed and confused
by setting the dte thus:-
TodaysDate = %Date();
I then extract each date element into a character string
using this command:-
H2LDATE = %Char(%Subdt(TodaysDate:*YEARS))
+ %Char(%Subdt(TodaysDate:*MONTHS))
+ %Char(%Subdt(TodaysDate:*DAYS));
The problem is that instead of '20040517', I get
'2004517 '.
Leading zeroes are dropped instead of represented by '0'.
Whats the best way to get round this?
Dazed and confused