Multiple Record Update (1 Viewer)

jpbtech

New member
Local time
Today, 01:28
Joined
Dec 3, 2008
Messages
1
I have a table (GIS Data) which contains a field called, "InstallDate." The field has date values ranging from "01-01-1930" to the current date.

There is a recently added field called, "InstallYr."

I need to update the "InstallYr" field based on the date in "InstallDate."

For example, if [InstallDate] = 01-01-1930, then [InstallYr] = 1930.

This is not as simple as using an Update Query which, in this case, only allows the update of one record at a time.

There are over 175,000 records within the table. I have exclusive use of the table. The database has been backed-up.

Can anyone suggest the bast way to handle this task?

Thank you,
JPBTech
 

Kiwiman

Registered User
Local time
Today, 07:28
Joined
Apr 27, 2008
Messages
799
Howzit

Firstly - you don't need to store the year in a separate field, you can extract using a query and the Datepart function when needed

Code:
SELECT DatePart("yyyy",[GIS Data]![InstallDate]) AS Yr
FROM ",[GIS Data];

However, if you really wanted to do the update you can do with an update query that will update all records...

Code:
UPDATE ",[GIS Data] SET ",[GIS Data].InstallYr= DatePart("yyyy",[GIS Data]![InstallDate]);
 

Users who are viewing this thread

Top Bottom