Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combining firstname and lastname field, how do you do it
Message
De
18/05/1999 16:02:04
Donny Sims
Independent Computer Consultants Inc
Scottsboro, Alabama, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00219772
Message ID:
00220205
Vues:
27
Joseph

Weird doesn't really quit cover how similar our posts were! I've often heard that great minds thing alike but did'nt realize they would also be synchronized.;-) You're not a long lost twin of mine are you? LOL

We did use prefixes at one time but dropped them after a few embarrassing instances of getting the wrong one attached to a name. I guess I misused the term primary index (within VFP space anyway), what I intended was the controlling index tag while looking up a name because the caller usually *does not* know their customer number. I full agree that names should not be used for primary keys, of course the real VFP programmers will say that customer codes are not good enough either. As for picklists, I usually also show city and street address which just about fits across the screen.

>Donny,
>
>This is weird. I referred to Marcus Welby in a post a few minutes ago in this thread.
>
>I did this before reading your post.
>
>2 cents Cdn.:
>
>I also think that a suffix is a good idea. A prefix too (Mr., Ms, Miss, Mrs, etc.).
>
>I know you mentioned promary keys on names and also on something like a customer number. I think some type of number/code should always be used instead of names. Names just are not unique. Customer numbers/codes are unique (as a rule). When I show pick lists of names, I usually show some other data too, like a birthdate.
>
>Take care,
>Joe
>
>>>How does everyone else manage the firstname and lastname fields in a database?
>>>
>>>Do you create a third field called name which is updated by an update trigger?
>>>
>>>person.lastname = "Delay"
>>>person.firstname = "Evan"
>>>person.name = "Delay, Evan" (trigger fills in??)
>>>
>>>I find that I am constantly combining the first and last name together to present to the user or for indexes..etc..
>>>
>>>Or do you use a function or a class...?
>>
>>My $.02US
>>
>>I've allways used seperate fields and then combined as desired. I even go a step farther and add a third field for name suffix (Jr, Sr, MD, ect). My users must access the person's records while on the phone with them and can see that their is a John Smith Jr. and a John Smith Sr. grouped together on the interactive search screen. This allows them to clearify who they are talking to before bringing up the entire record. Of course if your users are doing input from a form this may not be an issue. This also eliminates the question of wheather its a multi word last name or has a suffix, so if you have Marcus Welby MD you can sort on Welby, Marcus MD not Welby MD, Marcus. I also forbid nonalphas in the name fields and ignore spaces in the primary index,i.e. O'Mally, O Mally and OMally are equilivant. I've developed these rules mainly to reduce duplicate records cause by inconsistent input of names, if you use a different key field (like a customer number) then they won't make a big
>>difference.
Donny Sims

Life is what happens to us while were busy making other plans.
- John Lennon
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform