473,385 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Ways to deal with an occasional "txt string" in an otherwise "number" column

11
Not so much a problem as a discussion. I am currently in the early stages of designing a database to hold a bunch of water quality data (e.g., concentrations of heavy metals in drinking water). Water samples will be sent to a lab for analysis and the lab will send back a report (usually in excel or .txt format), that data will be imported into Access. If the concentration of a heavy metal is lower than the detectable limit of the analysis, the report does not return a “0” but a txt string (say “<0.01”). In my database I want the column to be a number, so I can run a query that return a range (e.g., “Between 0.05 And 0.6). I obviously can’t store the txt string in a numbers column and I don’t want to assign an extremely small dummy number (say 0.0000000001) as a place holder, because it messes up any “min”, “sum”, or “avg” formulas.

The only option I can think of, doubling the size of the table by having two columns for every heavy metal (one txt and one number). In the records were there are a txt string (<0.01), leave it as null in the number column. Then all my queries will have to be setup so that they search for the “<” symbol before running (and include or exclude these values depending on the type of query).

Any questions, suggestions, comments would be greatly appreciated.

Thanks.

DuckNut
Mar 22 '07 #1
1 1773
ADezii
8,834 Expert 8TB
Not so much a problem as a discussion. I am currently in the early stages of designing a database to hold a bunch of water quality data (e.g., concentrations of heavy metals in drinking water). Water samples will be sent to a lab for analysis and the lab will send back a report (usually in excel or .txt format), that data will be imported into Access. If the concentration of a heavy metal is lower than the detectable limit of the analysis, the report does not return a “0” but a txt string (say “<0.01”). In my database I want the column to be a number, so I can run a query that return a range (e.g., “Between 0.05 And 0.6). I obviously can’t store the txt string in a numbers column and I don’t want to assign an extremely small dummy number (say 0.0000000001) as a place holder, because it messes up any “min”, “sum”, or “avg” formulas.

The only option I can think of, doubling the size of the table by having two columns for every heavy metal (one txt and one number). In the records were there are a txt string (<0.01), leave it as null in the number column. Then all my queries will have to be setup so that they search for the “<” symbol before running (and include or exclude these values depending on the type of query).

Any questions, suggestions, comments would be greatly appreciated.

Thanks.

DuckNut
Assuming the [Concentration] Field is a Single Precision Data Type and is contained within a Query, create a Calculated Field within the Query. This Field will return a String if the Concentration is lower than the Detectable Limit and the actual Concentration itself if it isn't. This Calculated Field could then be used as a Control Source for a Field on your Report. The Calculated Field would look something like:
Expand|Select|Wrap|Line Numbers
  1. Return: IIf([Concentration]<0.01,"<0.01",[Concentration])
Output:
Expand|Select|Wrap|Line Numbers
  1. Concentration    Return
  2. 0.01             0.01
  3. 0.005             <0.01
  4. 0.05              0.05
  5. 0.0023             <0.01
Mar 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Jaime Wyant | last post by:
Will someone explain this to me? >>> "test".find("") 0 Why is the empty string found at position 0? Thanks! jw
3
by: Stephen Poley | last post by:
Could some kind soul explain the errors and warnings that the W3C CSS validator generates for page: http://www.atlis.nl/testsite/nl/ Results at: http://tinyurl.com/5pxqx The error "Invalid...
11
by: Nobody | last post by:
Heres the deal... I have an application where I have a list (as in a Windows list control, but thats not important) displayed to the user. I sort this list based on the list controls sort function...
2
by: privetv7 | last post by:
ppl... HELP!!!!! i don't know how to convert String into char..... for example i can do String input; int number; input = JOptionPane.showInputDialog( "Enter what ever" ); number =...
9
by: rsine | last post by:
I have developed a program that sends a command through the serial port to our business system and then reads from the buffer looking for a number. Everything worked great on my WinXP system, but...
4
by: Newsgroups | last post by:
Does anyone know what the VB.NET equivalent to the VB 6.0 String Function is?
3
by: John Torville | last post by:
Hi there, Does anyone know how to add ".txt" resources file to a C# project in Visual Studio. It should compile down to an embedded ".resources" file the same way as a ".resx" file. Thanks.
13
by: bwaichu | last post by:
Now, I read the faq, and it suggests using sprintf. However, I want to all ways know where the integer finishes in the string. Basically, I want to: nbr | other data But the other data all...
17
by: Petyr David | last post by:
Just looking for the simplest. right now my perl script returns an error messge to the user if the date string is invalid. would like to do this before accessing the server. TX
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.