Nullify Date

Hi Everybody,

I have stuck up with a problem that i have to assign null to the date. When i print the date variable it should give null value instead of "?".

Sample Ex,
DEFINE VARIABLE refdate AS DATE NO-UNDO.

I cannot give something like,
refdate = "".

So what can be done...
 
Well, in the OE world, ? *is* null. But, if it bothers you, format to a string and provide override processing to replace with your desired value.
 
define variable dtDate as date no-undo.
define variable chDate as character no-undo.

assign dtDate = whatever your source is.
if dtDate ne ?
then chDate = string(dtDate,"99/99/9999").
else chDate = "Unknown".

display chDate.
</pre>
 
define variable dtDate as date no-undo.
define variable chDate as character no-undo.

assign dtDate = whatever your source is.
if dtDate ne ?
then chDate = string(dtDate,"99/99/9999").
else chDate = "Unknown".

display chDate.
 
Back
Top