Populate new field

  • Thread starter Thread starter Dan @BCBS
  • Start date Start date
D

Dan @BCBS

I need to simplify a post with subject "Not Null"

Anyway, I added a field to a table that has a bunch of records. Obviously,
the new field displays Null, how can I add a date value to every record. The
reason I am doing this is because the field needs to be required.

Do I use some kind of update query?
 
UPDATE tblDan
SET tblDan.TheDate = #1/1/1950#
WHERE tblDan.TheDate Is Null;

Something like the update query above will work with the appropriate table
and field names.

#1/1/1950# is an example of the date. You can put something else in it
between the hashes ( # ). It must be a Date data type field though.

If the field is going to be required, consider making the default value of
the field Date() which will put in the current date for new records or Now()
which puts in the date and time. Users can change the data if they so wish.
 
I just used an update query and in Update To - I just put 1/1/01
It update all my records with a date.

But based on your comments I did add the default Now().

Thanks
 
Unless you really need the time, I suggest going with Date instead of Now.
For example if you do a query with the criteria #9/5/2008#, it probably won't
return any records as that's at midnight. If you have any times with that
date, records won't be returned. You need to do something like the following
to return records for that day.
 
Back
Top