How to create a table with different units of measure e.g. mA, uH, %, checkbox, ohms (1 Viewer)

Vector

New member
Local time
Yesterday, 20:32
Joined
Jun 27, 2017
Messages
6
Hello,
I have three tables (m-t-m):
-tblPart: PartID, PartNumber, PartDesc
-tblTest: TestID, TestName, PrameterNo, ParameterDesc, ParameterReqMin, ParameterReqMax, ParameterUnit
-tblPartTest: PartTestID, PartIDFK, TestIDFK, ActualReading

Question:
How do I setup:
-tblTest with different units (e.g ParameterDesc = Workmanship,
ParameterReqMin = blank, ParameterReqMax = Blank, ParameterUnit = Check(y/N)
-tblPartTest: ActualReading = Checkbox, or Number, LongInteger, % etc
 

isladogs

MVP / VIP
Local time
Today, 04:32
Joined
Jan 14, 2017
Messages
18,209
You can't setup field as different UNITS such as mA, V, ohms etc.
NOTE: I'm guessing uH = microhenrys?

You need to use standard Access datatypes - almost all are likely to be number - choose the appropriate type - probably double

Where appropriate you could format as %

There is a yes/no (boolean) datatype which you would use for ActualReading & ParameterUnit fields

Do a Google search for Access datatypes
 

MarkK

bit cruncher
Local time
Yesterday, 20:32
Joined
Mar 17, 2004
Messages
8,179
You could have a quantity field as a single or double, or whatever numeric type makes sense for your purpose, and then a UnitType field. UnitType could link back to a tUnitType table, or just be strings that you enter into the UnitType. Then you could filter the list by UnitType and perform calculations only on Units of the same type.

Imagine a table structure like this, for example's sake.
tResult
ResultID (PK)
TestID (FK to the overall test suite this result is a member of)
UnitTypeID (FK to the UnitType of this result)
Quantity
DateTime

tUnitType
UnitTypeID (PK)
UnitText
Description
Does that make sense at all?
Mark
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 13:32
Joined
Jan 20, 2009
Messages
12,851
I would separate the multipliers and units.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 23:32
Joined
Feb 19, 2002
Messages
43,223
I don't know where you are going with this but as long as you have a UOM on each record and the data types are identical, each row can have a different UOM. Of course if you are working with a set of data where the rows have different UOM's, and you want to do arithmetic with the values, you are responsible for figuring out what needs to convert to what.
 

Users who are viewing this thread

Top Bottom