Unique Key and Nulls...

J

Jack Doria

I have an Access 2000 database with a single column primary key
(incrementing number), and a composite unique key. I recently added a field
called InactiveDate. When I added the new field to the unique key
constraint, it now allows duplicate entries. I figure it has to do with the
fact that InactiveDate can contain Null values. I have Ignore Nulls set to
No on the index. If I take the InactiveDate field out of the UK, it
operates as normal for the four other fields in the key.

Does anyone out there know why Access is allowing duplicate entries when one
of the fields has a null value?

Thanks in advance,
Jack Doria
 
J

John Vinson

Does anyone out there know why Access is allowing duplicate entries when one
of the fields has a null value?

Because NULL means "this field has an unknown value, it could be
anything". Since two records with NULL values in a field might have
any value whatsoever in that field (you just don't know what those
values are), it cannot be assumed that they are identical. They might
be, or they might be different.
 

Ask a Question

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.

Ask a Question

Top