The Timestamps field is not a datetime field. To do what you want, you have to add a new column of type datetime or smalldatetime with the following default value: (getdate()) . The will display the creation date/time for new records.
After that, you add a trigger that will update this field each time the record is changed; something like:
CREATE TRIGGER MyTable_ModificationDate ON dbo.MyTable FOR UPDATE AS
Update E Set ModificationDate = getdate() From dbo.MyTable T inner join Inserted ins on T.IdKey = ins.IdKey
-- Sylvain Lafontaine, ing. MVP - Technologies Virtual-PC E-mail: http://cerbermail.com/?QugbLEWINF
"Atlas" <atlaspeak[ at ]my-deja.com> wrote in message news:11ou04mc6hmko3a[ at ]news.supernews.com...
[Quoted Text] > I'm discovering now that Timestamp fields aren't dates, but just unique > numbers. > Is that true or in those "unique numbers" there's a date part? Hope so, > 'cause I would like, given the timestamp column, select groups of records > modified in a date range... > If this is possible what type of Convert/cast statement must i issue in > the Select? > > Thanks >
|