Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Field Keys in a table

Status
Not open for further replies.

Maturi

IS-IT--Management
Oct 9, 2003
81
0
0
GB
Hi

I have a table with 3 Fields

- TableID (Autonumber primary key)
- RoleID (Number)
- StafID (Number)

I want to create an index combining RoleID and StaffID - (called Trevor)

I can create a multip field index using the menu item for this. And call it Trevor. But how do I access this key in say a Query?

Alternatively I could creat another field in the table which simply concatenates the 2 fields automatically. But how do I do that.

Sorry if these are basic questions for some you experts...

Thanks
 
you don't need to do anything to "access" an index. When you create an index on a field (or multiple fields) all it does is create an internal reference to the RDMS that allows faster searches to be performed when those fields are used.

[]
INDEX: Something that serves to guide, point out, or otherwise facilitate reference, especially:

1. An alphabetized list of names, places, and subjects treated in a printed work, giving the page or pages on which each item is mentioned.
2. A thumb index.
3. A table, file, or catalog.
4. Computer Science. A list of keywords associated with a record or document, used especially as an aid in searching for information.

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
the new field would work:
update my_table set new_field = field1 & field2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top