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 |
|
johnjasper
Starting Member
4 Posts |
Posted - 2007-03-18 : 20:58:56
|
| Hi,I am trying ot do a count with a clause like this "amtdue >=10000 and amtdue <=25000" --- I get and error that says "Syntax error converting the varchar value '52.91' to a column of data type int" There are 20 million records in the table - this field is formatted as a varchar - can someone help me find the problem?ThanksJohn |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-18 : 21:33:08
|
Tryamtdue >=10000.0 and amtdue <=25000.0 KH |
 |
|
|
johnjasper
Starting Member
4 Posts |
Posted - 2007-03-18 : 21:37:26
|
| I did 2 things to get my query to run,1. I did "set amtdue= 0 WHERE ISNUMERIC(amtdue)=0"2. Then I did "(cast(claimfile.amtdue as decimal) >=100.00 and cast(claimfile.amtdue as decimal) <=250.00))"It workedThank you khtan |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-18 : 21:50:32
|
Final step to fixed it once and for all, use correct data type for your amtdue. Like decimal / numeric KH |
 |
|
|
|
|
|