How do I get a datetime stamp on a single record instead of all the records. I have a colum for this with the getdate() formula but everytime I change one record it updates for all the records.
A column with a default value of getdate() will get the date and time when a new record is inserted providing you do not insert a value for that column. This value will not change when the row is updated.
Or the INSERT VALUES list could have getdate() for the value. Likewise the UPDATE could set the column equal to getdate() like this
Code:
UPDATE aTable SET useful_data = 'new value',
date_changed = getdate()
WHERE key_column = 'value_that_uniquely_identifies_the_row_to_be_changed'
It almost sounds like the WHERE clause is true for all of the rows in your table, but then the useful_data column would also be changed in all of the rows.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.