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
0 Sergey Alexandrovich Kryukov 585
1 mhegazy94 460
2 Ravi Bhavnani 230
3 Kornfeld Eliyahu Peter 185
4 Shemeemsha RA 160
0 Sergey Alexandrovich Kryukov 7,295
1 OriginalGriff 6,841
2 CPallini 5,420
3 George Jonsson 3,654
4 Gihan Liyanage 2,797


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100