Date...How do I...?

  • Thread starter Thread starter Tcs
  • Start date Start date
T

Tcs

I want to run a query (make table) that partially populates the new table. I want to keep track of
several dates. But I don't want to *enter* a date just yet. For one thing, I don't *know* the date
just yet. Do I have to enter some fictitious date, to make Access (2k3) create a date field in my
new table?

I found out that I can create a field using "Date()", then run an update query to update this date
to "null". Is this "okay"? Is there some other/better way?

Thanks in advance,

Tom
 
If you have a table structure you know (e.g., you want a field to be a
date/time field, even if there's no data in it yet), consider not using a
make table query.

Instead, create the table structure you wish to end up with, then build an
append query to add the records (or any/all fields thereof). If you need to
"start over", create a delete query to flush out the table, and use the
append query to "re-load" it.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
First, avoid Make Table queries. You don't always get the data type and
length you want. Text fields waste a lot of space. See Tools, Options,
Tables/Queries tab to see how your defaults are set up.

The better way to do this is to create a table with the date fields you want
and all your data types and text field lengths like you want them. The
rather than a make table query, use an append query to do the same data
loading. The one difference is, you may have to delete all the old data from
the table before you load the new data. I am making that assumption because
you were planning a make table which always deletes the old table.
Deleting the data is a simple enough task. You can do it with a Delete
query or if you are using any VBA in this exercise at all, it is a simple one
line SQL command:

CurrentDb.Execute("DELETE * FROM SomeTable;), dbFailOnError
 
Back
Top