I think i *will* loose my mind!
Thanks both of you for your help.
You see, the problem is that i can have a few flags at the end of the string
which mean somehing. e.g. M means missing, T means Trace, E means estimated,
etc.Information that i should have. If i split each column into two ,
well....possible but a lot of work and too much overhead since most
measurements are "clean".
That's the reason i kept the data in their original format.
Now if i dont convert to strings how the heck am i going to create the sql
string to send to the database with things like:
temperature between so and so, humidity bigger than 50, blah blah blah....
The string is created by an interface in VB where the user scrolls down
various controls and selects things. But how would you enter the bounds of
temperature in a textbox since its not stored as an integer AND it might
have a stupid letter at the end of its value!!!
I could do the coding after the results are returned.
I think My Biggest problem is string comparisons!!! If the user wants a
temperature between -7 and +15 how well and reliably can I create code to
compare "-00007" and "000015".
Just some thoughts from my brainstorming....
"Andy Williams" <f_u_b_a_r_1_1_1_9@y_a_h_o_o_._c_o_m> a écrit dans le
message de news: CIwgd.1071$wN4.303@newssvr16.news.prodigy.com...
[quoted text, click to view] > steve,
>
> SELECT * FROM Table1
> WHERE CAST(CASE RIGHT(Measurement, 1) WHEN 'M' THEN NULL ELSE Measurement
> END AS decimal) * .1
> BETWEEN -2.5 AND 12.4
>
> -Andy
>
> "steve" <noemail.@try.com> wrote in message
> news:S5wgd.49358$5t4.774343@wagner.videotron.net...
>> Hi,
>> I am trying to avoid a horrendous amount of coding and see if i can get
>> away with a complex sql statement.
>>
>> I have data values (measurements) which I have stored in the database in
>> the form of STRING so that i can keep the original format.
>>
>> They look like this:
>>
>> 000078 -> 7.8 degrees
>> -99999M -> Missing data
>> 000345 -> 34.5 degrees
>> -00993 -> -99.3 degrees
>> 000011 -> 1.1 degrees
>>
>> you get the idea.
>> They represent numbers (positive or negative) the last place is the
>> decimal , they all have 6 characters except the missing data which
>> is -99999M (7 places).
>>
>> How would I construct an SQL querry to be able to allow the user to
>> retrieve temperature between e.g. > -2.5 and <12.4 ?
>>
>> TIA
>> -steve
>>
>>
>>
>>
>
>