Monday, 10 December 2007

How to empty a datetime field ?

You have 2 methods to empty value in a datetime field.

First method is:
DateTimeField = 0DT;

Second method is
CLEAR (DateTimeField);

A common mistake make when trying to clear value in datetime field is to assign empty string to the datetime field.
DateTimeField = '';
This code will not work and you will get an error message.

1 comment:

Yogesh, India said...

DateTime = 0DT is also Quite Helpful for checking empty/null values before evaluating the it in date time field. Usually developers are more familiar with Date = 0D only.