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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create New Table From Oracle ODBC 1

Status
Not open for further replies.

Basia

Programmer
Apr 27, 2001
64
ML
I have setup a table in Access that when the switchboard form opens, it deletes all records and updates the table with current information. It works find. My only problem is that my index (Employee Number) is supposed to be unique, but there are two records out there that are duplicates because the staff person is covering two positions.

The table is based on a query. How do I get the query to skip the duplicate records, based on the employee number?

Thanks,
Basia
 
You could use the Unique properties of the query to pull only the proper people over. There are two of them:

[tt]
Unique Record: All fields in that record is compared against others for uniqueness.
Unique Value: All fields selected in the QBE grid are compared against other for uniqueness.
[/tt]

If you need more help, try looking up Unique Values in help.

Joe Miller
joe.miller@flotech.net
 
Thanks for getting back to me. Unfortunately this options are not catching the duplicate records since other data in the record is different. I need to have the Unique function look at a specific field. Any thoughts?
 
Make a query that has only the fields needed to determine a unique record. Then in the query you currently have relate the query with the unique records to the key field, then you'll only get the records that are unique.

Regards. Joe Miller
joe.miller@flotech.net
 
If the employee number is supposed to be unique then proper design would have it as the Primary Key. A second table containing the positions they fill would have a foreign key (EmpID) that would relate to the employee number.

EMPTABLE
EmpID Long Primary Key
EmpName Text

POSITION
PosID Long Primary Key
PosName Text
EmpID Long Foreign Key


This implements a one-many relationship using proper relational design techniques and prevents you from writing special code, looking in a single field, and managing the result uniquely.

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top