How to set a new field to a fix value in existing records

T

tomeck

I have a database of 35000 records and I need a new field in it that has the
same value for each record. For example, I need to add the new field to
identify the year the data was collected so that when I merge tables from
another year, I know which year the data was gathered and then can look at
the data from each year separately and combined.
 
D

Douglas J. Steele

Add the field to your table, then create an Update query that sets its value
to the correct year.
 
K

Klatuu

Doug's solution is correct, but I do have one question that may save your
time and disk space. Do you have a field in the table that has a date in it
where that date would always be in the year? If so, you can always filter on
the year portion of that field that having to create an additional field and
modify your app so it inserts the correct year in the future.
The filtering would be something like
WHERE Year([DateField]) = 1999
 

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

Top