How can I create an empty date field?

T

Tcs

Version: 2k3 (Probably stupid question...)

I need to create a table with a date field, but EMPTY. Can I? If so, how?

What I've done before, manually, is to create my date in a text field, then convert the type. I'd
much rather do it on the fly, if possible. I've tried:

CDate(0)

which *does* work, to create a Date type field, but it still has a time in it.

CDate(Null)

does not work.

Thanks in advance,

Tom
 
D

Douglas J. Steele

Assuming you've made the field not required, simply setting it to Null (no
need for CDate(Null)) should be sufficient.

If you've made it required, you have no choice but to live with the fact
that 0 gives you a time of midnight.
 
G

Gary Walter

Tcs said:
Version: 2k3 (Probably stupid question...)

I need to create a table with a date field, but EMPTY. Can I? If so, how?

What I've done before, manually, is to create my date in a text field, then convert the type. I'd
much rather do it on the fly, if possible. I've tried:

CDate(0)

which *does* work, to create a Date type field, but it still has a time in it.

CDate(Null)

does not work.

PMFBI

If this is in regards to a make-table query,
the trick is

SELECT
IIF(True, Null, CDate('1/1/1900') As NullDateField,

FROM

INTO
newtable;
 
J

John Spencer

Are you trying to do this with a maketable query?

Try using the following as your Column

IIF(True,Null,CDate(0)) as TheDateField
 
Top