![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
A composit key that is NOT the primary key can have NULL values in the fields. But because NULL <> NULL, all the other fields in the index can be equal without failing the index.Which is why NULL is not allowed in a primary key. |
#12
| |||
| |||
|
|
"bobh" <vulca... (AT) yahoo (DOT) com> wrote in message news:f9f08e69-440c-4ff7-8220-ea8f865dfb1d (AT) j8g2000yqd (DOT) googlegroups.com... On Aug 23, 4:07 pm, XPS35 <xps... (AT) gmail (DOT) com> wrote: First a few words on dutch names. In dutch a surname can consist of two parts: a (optional) prfix plus a surname. So "Piet van der Graaf" is a typical dutch name. In databases dutch surnames are stored in two fields. In my databes I have 4 fields which I want to be a ubique index: - First name (Piet) - Prefix to surname (van der) - Surname (Graaf) - Date of birth I created a index (unique, not primary, ignore nulls). If all fields are not null, everything works as hoped. Levaing the prefix null gives unwanted results. If I enter 2 records (Jan,null , Punt, 01/01/1960) Access aacepts both. What can I do to create a unique index with an optional field? TIA. -- Groeten, Peterhttp://access.xps350.com --- news://freenews.netfront.net/ - complaints: n... (AT) netfront (DOT) net --- Many times I have a field in my table generally called 'UKey' and when I'm saving a record I create a unique key with this instead of trying to create a primary key using other table fields MyRec!UKey = Format(Date, "mmddyyyy") & Format(Time(), "hhnnss") bobh. Seconds will not guarantee a unique value. Why not use a autonumber?- Hide quoted text - - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
| |