How can I set up a database that generates numbers based on imput

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i am trying to generate uniquie numbers for a bunch of PC ID's. These numbers
should be based on a few variables like location state, city. Any help?
 
Please tell us SPECIFICALLY what you want to do.

You want to enter what information? You wish to have it generate a number
in what format based on that information? Is this to be stored, or just
displayed for the user? Should it be sequential, but start over for each
state/city/etc?
 
It is really poor practice to create "meaningful" IDs. At some point they
tend to fail due to the inability to create a unique ID in a case you
haven't considered. Once that happens, the ID is no longer "meaningful".
 
i am trying to generate uniquie numbers for a bunch of PC ID's. These numbers
should be based on a few variables like location state, city. Any help?

I have to agree with Pat. Combining data from multiple fields,
encoding it somehow, and storing it redundantly in a new field is NOT
a good idea. Such a field is called an "Intelligent Key" - and that's
not a compliment! They're hard to maintain, and rarely provide any
benefit that cannot be attained by using a simple surrogate key such
as an autonumber.

John W. Vinson[MVP]
 
And I forgot to mention that "Intelligent Keys" violate all of the first
three normal forms!!
1. The field is not atomic
2. The parts of the key contain redundant data
3. Columns of the table are not dependent on the entire key
 
And I forgot to mention that "Intelligent Keys" violate all of the first
three normal forms!!
1. The field is not atomic
2. The parts of the key contain redundant data
3. Columns of the table are not dependent on the entire key

Or as I learned back in my first relational database class:

"I swear to base each field on the Key, the whole Key, and nothing but
the Key, so help me Codd!"

John W. Vinson[MVP]
 
Back
Top