Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable convert varchar to Decimal, in dynamic query

Status
Not open for further replies.

VIJSQL01

Programmer
Oct 30, 2010
74
US
hi,

i am unable to convert Varchar to Decimal. I am getting error as follows.

Code:
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.

SQL query used:

Code:
select * from RT_STATE_MASTER where Convert(Decimal(10,4),CAP_RATE_MEAN)<0

i would like to mention here that, when i execute the query, the results appears and suddenly disappears by throwing the above error message. Earlier i never faced this kind of issue. For the same query, i used to get the results. This is something new and weird for me.
Please advise on this. Thanks.
 
try this query
Code:
select * from RT_STATE_MASTER where isnumeric(CAP_RATE_MEAN) = 0

The rows returned will be cause of your problems

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Great! Thank You Thank You Thank You....Thanks a ton. This solution worked for me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top