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!

Table with an internal unique combination?

Status
Not open for further replies.

MattGreer

Technical User
Feb 19, 2004
471
0
0
US
I have a table called "Instrumentation". Each instrument has a unique ID (e.g. AI101, AI102, AI456, etc.) but can report more than one type of data. For example, a particular instrument can report Flow, Temperature and Pressure. I need to be able to differentiate this feedback in another table that shows the time stamp of each reported value. In a way, I'm sort of setting up a Historian (if you're familiar with that sort of thing).

So, for example, AI101, reports a Pressure value of 15 at 9:01 AM, then reports a Temperature measurement of 120 at 9:02 AM, then a Flow measurement of 500 at 9:03 AM.

I thought about setting the table up as follows:

InstrumentID (PK)
InstName
Type

So the Instrument Name would be AI101, and the Type could be Pressure, Temperature, or Flow. You cannot have the combination of AI101, Pressure more than once.

To further confuse the issue, there are many Locations where you can find AI101, Pressure.

How do I ensure that I do not have the combination of AI101, Pressure more than once in my table?


In case it's important, the InstrumentID would be a Foreign Key in another table called RunData, where the setup would be:

RunDataID (PK) - Unique ID for the entry in the table
TimeStamp - the time that the data was reported
InstrumentID (FK) - relates back to the Instrumentation table
FieldValue - the value that was reported


Thank you for your help!!



Thanks!!


Matt
 
I believe I found my answer. I need to create an individual index in Access and add the two fields to it.

This post here led me to my answer:
When doing this in Access, you need to make sure that you change the options at the bottom of the pop-up window to include "Unique" to indicate "Yes".

Hope someone else finds this information useful.

Thanks!!


Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top