October 8, 2003 at 9:35 am
I have a database that some areas want to use emglish measurments and some want metric.
How would you implement this.
A: Have everything stored in one system
and have views converting to the other,
B: Have a field with the unit system beside it. and convert as needed
C: have both using calculated fields
D: anyother ideas
October 9, 2003 at 2:49 pm
I don't have enough information to give you a definitive suggestion, but perhaps create a units table and a conversions table and then have columns for both measurement and unit wherever the measurements are stored. I guess that's your choice B.
This has advantages over your other options:
If you need all data within an area to be entered in only one system, then use a default constraint and don't insert or update the Unit columns.
--Jonathan
--Jonathan
October 10, 2003 at 2:23 am
I would definitely stick to storing all data in a single unit.
You could use views to convert stuff. But then again, I believe that displaying a value in a certain unit is a client thing and should not be handled by the server.
October 10, 2003 at 2:28 am
Just reread your post. If you are talking about 'areas', you might need to store different units.
E.g. a table about volumes in gallons and one about lengths in millimeters.
Any governance laws to obey by? If I'm thinking about banking transactions, this won't hold. It is a regulatory requirement here that the amount is stored in the currency it was entered. So we do have some tables with different 'units' in there ($, €, £, ...).
Another issue could be accuracy, since any conversion sooner or later will yield a (small) difference.
October 13, 2003 at 9:21 am
I personaly am leaning towards A. Which is similar to letting the client handle (since I will be writing the client).
There are no goverment rules in this application.
Yes there will be different units of measeure volume, length, but i am specificly asking about diffrent systems of measure SI, English. for the same length.
I figure in the client there will be an option for using one system or the other. That basicly just toggles which views and sp's get used.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply