This is normally not a good idea.
Discussion follows, but the main thing, speaking as the voice of
experience, is that it is possible that later you will want to use an
append query with multiple records as a data source, and all the
Date/Time values will be identical, forcing you to jump though
hoops to enter the records.
Anyway, more theoretical objections:
In a JET/MDB database, date/time is stored as a real (floating point)
number.
Floating point numbers are not a good choice of primary key because
they are not exact. You may have two floating point numbers that are
the same, but different. Or you may have two floating point numbers
that are different, but the same.
If you are only using the DATE part of the date/time, this is less of an
issue. Floating point numbers still make inefficient keys: there is a lot
of overhead in handling floating point numbers, but at least they won't
accidentally clash or get lost.
I have to say that in real life, with a JET/MDB database, using real
dates and times, you probably won't see this as a problem, with the
current version of JET. Still, that doesn't make it a good idea.
Also, as a secondary consideration, Date/Time and floating point numbers
are a really bad choice for use with SQL Server. SQL Server Date/Times
are stored differently, so none of your Date/Times would match exactly,
and floating point numbers don't always translate exactly either, so you
couldn't fake it that way either.
Again, you might not see this problem until you add the automated interface
or web interface, and it tries to add multiple records at the same time, but
for Access/SQL Server it is just a really bad idea anyway, and you want to
avoid it.
(david)
mscertified said:
Are there any issues in having a date/time field as my primary key?
thanks.