Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2005-01-05 : 12:35:56
|
| I have a table called Blood PressureID BP1 130/882 150/803 117/724 112/725 130/806 154/110I want to retrieve the ID which has BP <= 130/80(High / Low) The result should looks like:ID BP3 117/724 112/725 130/80How can I do this comparison since BP is the varchar data type? |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-01-05 : 12:56:35
|
| something likewhere convert(int,left(BP,charindex('/',BP)-1)) <= 130and convert(int,right(BP,charindex('/',reverse(BP))-1)) <= 80You should store the two values in different columns.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|