Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-server-2005
Error converting data type varchar to numeric.
Warning: Null value is eliminated by an aggregate or other SET operation.
 
CAN U PLS TELL ME HOW TO FIX THIS ERROR
Posted 25-Jun-12 1:28am
Comments
Wes Aday at 25-Jun-12 7:32am
   
Your varchar cannot be converted to a numeric value. Seriously, you expect someone on the internet to debug your code for you? Code that you did not bother to post? And then screaming at us besides that? What on earth does "u pls" mean any way? No such word as "u" or "pls" in the English language.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

From the exact wording of the message, I would suspect that your varchar data is in a field which can contain null values. And does. You can't convert a null to a numeric value - or indeed to any other type.
 
Don't store numerics in string fields - store them in numeric fields where you can do math on them directly.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi Premkumar !!
 
always write that Block of code in which you are getting error .
beside that it is not possible to the members to find right solution .
In your case this is very difficult to find that what data( Numeric , or string or
what is exactly did you tried to convert to Integer so that you got this ERROR
 
Hope you understood .
 
now its your turn to improve your Question .
!!
  Permalink  
Comments
premkumar.r at 25-Jun-12 7:58am
   
SELECT (CAST(GLM_OPENING_BAL) DECIMAL(19,2)) FROM T_M_GLMST..THIS IS MY CODING SIR
gauravupadhyay at 25-Jun-12 9:12am
   
write your query like this select cast ((GLM_OPENING_BAL ) as decimal(19 , 2 )) as @GLM_OPENING_BAL from T_M_GLMST
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

I guess your question because there is no mention any type of query statement,
so i suggest some Query if it is use full for you.
 
select cast((case when Column_name='' then 0 else   IsNull (Column_name,0)  end) as Numeric(18,2)) as @Column_name
  Permalink  
Comments
premkumar.r at 25-Jun-12 9:27am
   
IM USING SUM(Column_name)..SO IM NOT ABLE TO USE THIS CONCEPT
Member 9896532 at 11-Apr-13 6:29am
   
Error converting data type varchar to numeric. how to solve it in sql server 2008 ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 840
1 OriginalGriff 508
2 Abhinav S 278
3 thatraja 225
4 Emre Ataseven 200
0 Sergey Alexandrovich Kryukov 8,142
1 OriginalGriff 4,665
2 Peter Leow 3,774
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 25 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid