How can I create an empty date field?

  • Thread starter Thread starter Tcs
  • Start date Start date
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
 
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.
 
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;
 
Are you trying to do this with a maketable query?

Try using the following as your Column

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top