L
LAS
I have a table with a date, time and ID field. I want them all,
concatenated, to constitute a primary key. Can I do that?
concatenated, to constitute a primary key. Can I do that?
I have a table with a date, time and ID field. I want them all,
concatenated, to constitute a primary key. Can I do that?
I have a table with a date, time and ID field. I want them all,
concatenated, to constitute a primary key. Can I do that?
Don't.
For one thing, a Date/Time field works best when you have the date and time
stored in the same field.
However you do not want a date/time field to be a primary or even
foreign key. The problem is that under the covers a date field is
actually a Double field type. And the portion to the right of the
decimal point might cause troubles due to how floating point
numbers are recorded in computers.
For one thing, a Date/Time field works best when you have the date
and time stored in the same field.
For a second, a Date/Time field (or two of them) are
risky as Primary Keys, as Tony says.
For a third, creating a concatenated
redundant field containing data from three other fields is simply
*not* good design.
Tony Toews said:Finally you state you have an ID field. By this do you mean an
autonumber field? If so why not just use that as the primary key that
child tables reference?
John W. Vinson said:Don't.
For one thing, a Date/Time field works best when you have the date and
time
stored in the same field.
risky as Primary Keys, as Tony says. For a third, creating a concatenated
redundant field containing data from three other fields is simply *not*
good
design.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.