Record Creation Date

K

KARL DEWEY

Only if your table includes a DateTime field with default of Now() so that it
stores the date and time when the record is created.
 
J

Jamie Collins

Only if your table includes a DateTime field with default of Now() so that it
stores the date and time when the record is created.

Did you test a little? There's more to it than that:

CREATE TABLE PrivateTest
(
ID INTEGER NOT NULL UNIQUE,
date_stamp DATETIME DEFAULT NOW() NOT NULL
)
;
INSERT INTO PrivateTest (ID, date_stamp)
VALUES (1, #1990-01-01 00:00:00#)
;
SELECT ID, date_stamp
FROM PrivateTest
;

Oops! That row didn't get the correct timestamp i.e. not today's date.

The 'timestamp' column should perhaps be hidden:

CREATE VIEW PublicTest (ID) AS
SELECT ID
FROM PrivateTest
;
INSERT INTO PublicTest (ID)
VALUES (2)
;
SELECT ID, date_stamp
FROM PrivateTest
;

Now REVOKE permissions from PUBLIC on the base table and grant them
instead to the VIEW.

Jamie.

--
 
Top