none
CAST in CASE throws 'Arithmetic overflow error converting varchar to data type numeric.' RRS feed

  • Question

  • Hey guys

    I'm working on a SELECT with CASEs and CASTs but it doesn't work proper.

    Both CASEs bellow are supposed to make the same.

    My simplified code:

    DECLARE @Value INTEGER
    SELECT @Value = 5
    
    SELECT
    	CASE @Value -- CASE A
    		WHEN NULL THEN '-'
    		WHEN 0 THEN '--'
    		ELSE CAST(@Value AS DECIMAL(5,2))
    	END AS 'Case1',
    	
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE CAST(@Value AS DECIMAL(5,2))
    	END AS 'Case2'
    				

    this will return

    Case1 Case2
    5.00 5.00

    which is fine

    but when I change the @Value to NULL or 0

    SELECT @Value = NULL

    the cases should actually return '-' (or '--' for Case1 when I change @Value to 0), but instead it throws me an error: 'Arithmetic overflow error converting varchar to data type numeric.'

    But why doesn't the case work in this case? It really blows my mind as it works when I dont cast anything and return a string instead, but only on the 2nd case:

    DECLARE @Value INTEGER
    SELECT @Value = NULL
    
    SELECT
    	CASE @Value -- CASE A
    		WHEN NULL THEN '-'
    		WHEN 0 THEN '--'
    		ELSE 'not NULL or 0'
    	END AS 'Case1',
    	
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE 'not NULL or 0'
    	END AS 'Case2'
    				


    this will return

    Case1 Case2
    not NULL or 0 -

    instead of 

    Case1 Case2
    - -

    What's wrong with my code?



    I appreciate it very much if you vote my Replies as Helpful or Mark as Answer if I could help you out. Thanks!

    Wednesday, June 27, 2012 1:19 PM

Answers

  • You do not understand how NULLs and CASE work. And neither do a lot of the other people here. Patel's advice to turn off ANSI is dangerous, destroys portability and tells the world that you are still in 1970's non-ANSI Sybase SQL Server. 

    "x = NULL" always evaluates to UNKNOWN. That is the nature of NULL. This si why we use "x IS NULL" instead. 

    The CASE expression is an *expression* and not a control statement; that is, it returns a value of one data type.  SQL-92 stole the idea and the syntax from the ADA programming language.  Here is the BNF for a <case specification>:

     <case specification> ::= <simple case> | <searched case>

     <simple case> ::=
        CASE <case operand>
          <simple when clause>...
          [<else clause>]
        END

     <searched case> ::=
        CASE
          <searched when clause>...
          [<else clause>]
        END

     <simple when clause> ::= WHEN <when operand> THEN <result>

     <searched when clause> ::= WHEN <search condition> THEN <result>

     <else clause> ::= ELSE <result>

     <case operand> ::= <value expression>

     <when operand> ::= <value expression>

     <result> ::= <result expression> | NULL

     <result expression> ::= <value expression>

    The searched CASE expression is probably the most used version of the expression.  The WHEN ... THEN ... clauses are executed in left to right order.  The first WHEN clause that tests TRUE returns the value given in its THEN clause.  And, yes, you can nest CASE expressions inside each other.  If no explicit ELSE clause is given for the CASE expression, then the database will insert a default ELSE NULL clause.  If you want to return a NULL in a THEN clause, then you must use a CAST (NULL AS <data type>) expression.  I recommend always giving the ELSE clause, so that you can change it later when you find something explicit to return.  

    The <simple case expression> is defined as a searched CASE expression in which all the WHEN clauses are made into equality comparisons against the <case operand>.  For example

      CASE iso_sex_code
      WHEN 0 THEN 'Unknown'
      WHEN 1 THEN 'Male'
      WHEN 2 THEN 'Female'
      WHEN 9 THEN 'N/A'
      ELSE NULL END

    could also be written as:

      CASE 
      WHEN iso_sex_code = 0 THEN 'Unknown'
      WHEN iso_sex_code = 1 THEN 'Male'
      WHEN iso_sex_code = 2 THEN 'Female'
      WHEN iso_sex_code = 9 THEN 'N/A'
      ELSE NULL END

    There is a gimmick in this definition, however.  The expression

     CASE foo
     WHEN 1 THEN 'bar'
     WHEN NULL THEN 'no bar'
     END

    becomes 

     CASE WHEN foo = 1 THEN 'bar'
          WHEN foo = NULL THEN 'no_bar'  -- error!
          ELSE NULL END 

    The second WHEN clause is always UNKNOWN.  

    The SQL-92 Standard defines other functions in terms of the CASE expression, which makes the language a bit more compact and easier to implement.  For example, the COALESCE () function can be defined for one or two expressions by

    1) COALESCE (<value exp #1>) is equivalent to (<value exp #1>) 

    2) COALESCE (<value exp #1>, <value exp #2>) is equivalent to 

       CASE WHEN <value exp #1> IS NOT NULL 
            THEN <value exp #1> 
            ELSE <value exp #2> END

    then we can recursively define it for (n) expressions, where (n >= 3), in the list by 

    COALESCE (<value exp #1>, <value exp #2>, . . ., n), as equivalent to:

       CASE WHEN <value exp #1> IS NOT NULL 
            THEN <value exp #1> 
            ELSE COALESCE (<value exp #2>, . . ., n) 
       END

    Likewise, NULLIF (<value exp #1>, <value exp #2>) is equivalent to:

       CASE WHEN <value exp #1> = <value exp #2> 
            THEN NULL 
            ELSE <value exp #1> END

    It is important to be sure that you have a THEN or ELSE clause with a data type that the compiler can find to determine the highest data type for the expression.  

    A trick in the WHERE clause is use it for a complex predicate with material implications. 

    WHERE CASE 
          WHEN <search condition #1> 
          THEN 1  
          WHEN <search condition #2> 
          THEN 1  
           ...
          ELSE 0 END  = 1

    Gert-Jan Strik posted some exampels of how ISNULL() and COALESCE() on 2004 Aug 19

    CREATE TABLE #t(a CHAR(1));
    INSERT INTO #t VALUES (NULL);
    SELECT ISNULL(a,'abc') FROM #t; 
    SELECT COALESCE(a, 'abc') FROM #t; 
    DROP TABLE #t;

    He always use COALESCE, with the exception of the following type of 
    situation, because of its performance consequences: 

    SELECT ..., 
      ISNULL((SELECT COUNT(*)  -- or other aggregate 
               FROM B 
              WHERE B.key = A.key), 0) 
    FROM A;

    Likewise, Alejandro Mesa came up with this example:

    SELECT 13 / COALESCE(CAST(NULL AS INTEGER), 2.00); -- promote to highest type (decimal)
    SELECT 13 / ISNULL(CAST(NULL AS INTEGER), 2.00); -- promote to first type (integer)



    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking in Sets / Trees and Hierarchies in SQL

    • Proposed as answer by Naomi NModerator Wednesday, June 27, 2012 5:27 PM
    • Marked as answer by Ronin47 Thursday, June 28, 2012 8:29 AM
    Wednesday, June 27, 2012 1:48 PM
  • You need to convert decimal back to VARCHAR (as shown below) as other CASE THEN expressions of type VARCHAR.

    DECLARE @Value INTEGER
    SELECT @Value = 0
    
    SELECT
    	CASE @Value -- CASE A
    		WHEN NULL THEN '-'
    		WHEN 0 THEN '--'
    		ELSE CONVERT(VARCHAR(10), CAST(@Value AS DECIMAL(5,2)))
    	END AS 'Case1',
    	
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE CONVERT(VARCHAR(10), CAST(@Value AS DECIMAL(5,2)))
    	END AS 'Case2'

    Thanks!
    • Marked as answer by Ronin47 Thursday, June 28, 2012 8:29 AM
    Wednesday, June 27, 2012 1:33 PM
  • > What's wrong with my code?

    The data type of the value coming from a CASE function, is the data type with higher precedence among all THEN / ELSE parts. In your example (CASE A) it will be DECIMAL(5, 2), but the literal '-' can't be converted to decimal.

    -- error
    select cast('-' as decimal(5, 2)) as c1;
    GO

    Also notice the way you are comparing the value of the variable to NULL mark. You can't use the simple format of CASE to compare to NULL mark.

    -- wrong
    select case NULL when NULL then 1 else 0 end as c1;
    GO

    You could use the searched format though.

    select
        case
        when @value is null then '-'
        when @value = 0 then '--'
        else str(@value, 5, 2)
        end as c1;
    GO


    AMB

    Some guidelines for posting questions...


    Wednesday, June 27, 2012 1:35 PM
    Moderator

All replies

  • try this :

    DECLARE @Value INTEGER
    SELECT @Value = NULL
    
    SELECT 
    	CASE ISNULL(@Value,0) -- CASE A
    		WHEN 0 THEN '-'
    		WHEN NULL THEN '--'
    		ELSE 'not NULL or 0'
    	END AS 'Case1',
    	
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE 'not NULL or 0'
    	END AS 'Case2'


    Please vote if you find this posting was helpful or Mark it as answered.

    Wednesday, June 27, 2012 1:27 PM
  • DECLARE @Value INTEGER
    SELECT @Value = NULL
    
    SELECT
    	CASE @Value -- CASE A
    		WHEN NULL THEN '-'
    		WHEN 0 THEN '--'
    		ELSE CAST(@Value AS VARCHAR(10))
    	END AS 'Case1',
    	
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE CAST(@Value AS VARCHAR(10))
    	END AS 'Case2'


    Wednesday, June 27, 2012 1:29 PM
  • Hey guys

    I'm working on a SELECT with CASEs and CASTs but it doesn't work proper.

    Both CASEs bellow are supposed to make the same.

    My simplified code:

    DECLARE @Value INTEGER
    SELECT @Value = 5
    
    SELECT
    	CASE @Value -- CASE A
    		WHEN NULL THEN '-'
    		WHEN 0 THEN '--'
    		ELSE CAST(@Value AS DECIMAL(5,2))
    	END AS 'Case1',
    	
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE CAST(@Value AS DECIMAL(5,2))
    	END AS 'Case2'
    				

    this will return

    Case1 Case2
    5.00 5.00

    which is fine

    but when I change the @Value to NULL or 0

    SELECT @Value = NULL

    the cases should actually return '-' (or '--' for Case1 when I change @Value to 0), but instead it throws me an error: 'Arithmetic overflow error converting varchar to data type numeric.'

    But why doesn't the case work in this case? It really blows my mind as it works when I dont cast anything and return a string instead, but only on the 2nd case:

    DECLARE @Value INTEGER
    SELECT @Value = NULL
    
    SELECT
    	CASE @Value -- CASE A
    		WHEN NULL THEN '-'
    		WHEN 0 THEN '--'
    		ELSE 'not NULL or 0'
    	END AS 'Case1',
    	
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE 'not NULL or 0'
    	END AS 'Case2'
    				


    this will return

    Case1 Case2
    not NULL or 0 -

    instead of 

    Case1 Case2
    - -

    What's wrong with my code?



    I appreciate it very much if you vote my Replies as Helpful or Mark as Answer if I could help you out. Thanks!

    You can try this :

    SET ANSI_NULLS OFF for check = NULL  and IS NULL

    see :

    DECLARE @Value INTEGER
    SELECT @Value = NULL
    
    SET ANSI_NULLS OFF
    
    SELECT 
    	CASE @Value -- CASE A
    		WHEN NULL THEN '-'
    		WHEN 0 THEN '--'
    		ELSE 'not NULL or 0'
    	END AS 'Case1',
    	
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE 'not NULL or 0'
    	END AS 'Case2'


    Please vote if you find this posting was helpful or Mark it as answered.

    Wednesday, June 27, 2012 1:30 PM
  • You need to convert decimal back to VARCHAR (as shown below) as other CASE THEN expressions of type VARCHAR.

    DECLARE @Value INTEGER
    SELECT @Value = 0
    
    SELECT
    	CASE @Value -- CASE A
    		WHEN NULL THEN '-'
    		WHEN 0 THEN '--'
    		ELSE CONVERT(VARCHAR(10), CAST(@Value AS DECIMAL(5,2)))
    	END AS 'Case1',
    	
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE CONVERT(VARCHAR(10), CAST(@Value AS DECIMAL(5,2)))
    	END AS 'Case2'

    Thanks!
    • Marked as answer by Ronin47 Thursday, June 28, 2012 8:29 AM
    Wednesday, June 27, 2012 1:33 PM
  • > What's wrong with my code?

    The data type of the value coming from a CASE function, is the data type with higher precedence among all THEN / ELSE parts. In your example (CASE A) it will be DECIMAL(5, 2), but the literal '-' can't be converted to decimal.

    -- error
    select cast('-' as decimal(5, 2)) as c1;
    GO

    Also notice the way you are comparing the value of the variable to NULL mark. You can't use the simple format of CASE to compare to NULL mark.

    -- wrong
    select case NULL when NULL then 1 else 0 end as c1;
    GO

    You could use the searched format though.

    select
        case
        when @value is null then '-'
        when @value = 0 then '--'
        else str(@value, 5, 2)
        end as c1;
    GO


    AMB

    Some guidelines for posting questions...


    Wednesday, June 27, 2012 1:35 PM
    Moderator
  • Part of the problem is resulting from the way NULL's behave in comparisons.  The only effective to test for a null value is to use the "IS NULL" clause (since NULL compared to anything returns a NULL value -- which is not true).  You can see this if you do something like the following:

    -- this select returns no rows.
    SELECT 'x' WHERE NULL = NULL
    -- this select returns one row
    SELECT 'x' WHERE NULL IS NULL

    The other problem is that SQL Server is attempting to convert the '-' (case B) into a floating point value (implicit conversions are not your friend).   If you want to achieve the result you indicated above you can do something like the following which will always convert to a varchar value:

    DECLARE @Value INTEGER
    SELECT @Value = null
    SELECT
    	CASE @Value -- CASE A
    		WHEN NULL THEN '-'
    		WHEN 0 THEN '--'
    		ELSE str(@Value,5,2)
    	END AS 'Case1',
    	
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE  str(@Value,5,2)
    	END AS 'Case2'

    Wednesday, June 27, 2012 1:37 PM
  • Iissue is because of the data type presidence. DECIMAL is higher in order of presidence than character fata types. So when you execute the below searched case expression:

    DECLARE @Value INTEGER
    SELECT @Value = NULL
    
    SELECT
    
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE CAST(@Value AS DECIMAL(5,2))
    	END AS 'Case2'

    Query engine evaluate the final output as DECIMAL and the boolean expression @Value IS NULL evaluate to TRUE and the engine try to convert the character '-' to DECIMAL (5, 2). So you get arithmetic overflow error. Workaround is to use the CAST as below:

    ELSE CAST(CAST(@Value AS DECIMAL(5,2)) AS VARCHAR(10))
    So the query engine evaluate the result expressin as VARCHAR.

    Krishnakumar S


    Wednesday, June 27, 2012 1:42 PM
  • You do not understand how NULLs and CASE work. And neither do a lot of the other people here. Patel's advice to turn off ANSI is dangerous, destroys portability and tells the world that you are still in 1970's non-ANSI Sybase SQL Server. 

    "x = NULL" always evaluates to UNKNOWN. That is the nature of NULL. This si why we use "x IS NULL" instead. 

    The CASE expression is an *expression* and not a control statement; that is, it returns a value of one data type.  SQL-92 stole the idea and the syntax from the ADA programming language.  Here is the BNF for a <case specification>:

     <case specification> ::= <simple case> | <searched case>

     <simple case> ::=
        CASE <case operand>
          <simple when clause>...
          [<else clause>]
        END

     <searched case> ::=
        CASE
          <searched when clause>...
          [<else clause>]
        END

     <simple when clause> ::= WHEN <when operand> THEN <result>

     <searched when clause> ::= WHEN <search condition> THEN <result>

     <else clause> ::= ELSE <result>

     <case operand> ::= <value expression>

     <when operand> ::= <value expression>

     <result> ::= <result expression> | NULL

     <result expression> ::= <value expression>

    The searched CASE expression is probably the most used version of the expression.  The WHEN ... THEN ... clauses are executed in left to right order.  The first WHEN clause that tests TRUE returns the value given in its THEN clause.  And, yes, you can nest CASE expressions inside each other.  If no explicit ELSE clause is given for the CASE expression, then the database will insert a default ELSE NULL clause.  If you want to return a NULL in a THEN clause, then you must use a CAST (NULL AS <data type>) expression.  I recommend always giving the ELSE clause, so that you can change it later when you find something explicit to return.  

    The <simple case expression> is defined as a searched CASE expression in which all the WHEN clauses are made into equality comparisons against the <case operand>.  For example

      CASE iso_sex_code
      WHEN 0 THEN 'Unknown'
      WHEN 1 THEN 'Male'
      WHEN 2 THEN 'Female'
      WHEN 9 THEN 'N/A'
      ELSE NULL END

    could also be written as:

      CASE 
      WHEN iso_sex_code = 0 THEN 'Unknown'
      WHEN iso_sex_code = 1 THEN 'Male'
      WHEN iso_sex_code = 2 THEN 'Female'
      WHEN iso_sex_code = 9 THEN 'N/A'
      ELSE NULL END

    There is a gimmick in this definition, however.  The expression

     CASE foo
     WHEN 1 THEN 'bar'
     WHEN NULL THEN 'no bar'
     END

    becomes 

     CASE WHEN foo = 1 THEN 'bar'
          WHEN foo = NULL THEN 'no_bar'  -- error!
          ELSE NULL END 

    The second WHEN clause is always UNKNOWN.  

    The SQL-92 Standard defines other functions in terms of the CASE expression, which makes the language a bit more compact and easier to implement.  For example, the COALESCE () function can be defined for one or two expressions by

    1) COALESCE (<value exp #1>) is equivalent to (<value exp #1>) 

    2) COALESCE (<value exp #1>, <value exp #2>) is equivalent to 

       CASE WHEN <value exp #1> IS NOT NULL 
            THEN <value exp #1> 
            ELSE <value exp #2> END

    then we can recursively define it for (n) expressions, where (n >= 3), in the list by 

    COALESCE (<value exp #1>, <value exp #2>, . . ., n), as equivalent to:

       CASE WHEN <value exp #1> IS NOT NULL 
            THEN <value exp #1> 
            ELSE COALESCE (<value exp #2>, . . ., n) 
       END

    Likewise, NULLIF (<value exp #1>, <value exp #2>) is equivalent to:

       CASE WHEN <value exp #1> = <value exp #2> 
            THEN NULL 
            ELSE <value exp #1> END

    It is important to be sure that you have a THEN or ELSE clause with a data type that the compiler can find to determine the highest data type for the expression.  

    A trick in the WHERE clause is use it for a complex predicate with material implications. 

    WHERE CASE 
          WHEN <search condition #1> 
          THEN 1  
          WHEN <search condition #2> 
          THEN 1  
           ...
          ELSE 0 END  = 1

    Gert-Jan Strik posted some exampels of how ISNULL() and COALESCE() on 2004 Aug 19

    CREATE TABLE #t(a CHAR(1));
    INSERT INTO #t VALUES (NULL);
    SELECT ISNULL(a,'abc') FROM #t; 
    SELECT COALESCE(a, 'abc') FROM #t; 
    DROP TABLE #t;

    He always use COALESCE, with the exception of the following type of 
    situation, because of its performance consequences: 

    SELECT ..., 
      ISNULL((SELECT COUNT(*)  -- or other aggregate 
               FROM B 
              WHERE B.key = A.key), 0) 
    FROM A;

    Likewise, Alejandro Mesa came up with this example:

    SELECT 13 / COALESCE(CAST(NULL AS INTEGER), 2.00); -- promote to highest type (decimal)
    SELECT 13 / ISNULL(CAST(NULL AS INTEGER), 2.00); -- promote to first type (integer)



    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking in Sets / Trees and Hierarchies in SQL

    • Proposed as answer by Naomi NModerator Wednesday, June 27, 2012 5:27 PM
    • Marked as answer by Ronin47 Thursday, June 28, 2012 8:29 AM
    Wednesday, June 27, 2012 1:48 PM
  • Thx for your answer.

    This sounds like a logical and good explanation for the problem, but what's the solution to fix it?

    CONVERT(VARCHAR(10), CAST(@Value AS DECIMAL(5,2)))

    seems to work as suggested by Deepak Munigela.

    Would you recommend it?


    I appreciate it very much if you vote my Replies as Helpful or Mark as Answer if I could help you out. Thanks!

    Wednesday, June 27, 2012 2:04 PM
  • Hi,

    The out value for all the case would have same datatype

    try this code

    DECLARE @Value INTEGER
    SELECT @Value = 5
    
    SELECT
    	CASE @Value -- CASE A
    		WHEN NULL THEN '-'
    		WHEN 0 THEN '--'
    		ELSE convert( varchar ,CAST(@Value AS DECIMAL(5,2)))
    	END AS 'Case1',
    	
    	CASE -- CASE B
    		WHEN @Value IS NULL OR @Value = 0
    			THEN '-'
    			ELSE convert( varchar ,CAST(@Value AS DECIMAL(5,2)))
    	END AS 'Case2'
    				
    Regards
    Satheesh
    Wednesday, June 27, 2012 2:06 PM
  • Thx for your answer.

    This works in this case as well but I want to do a calculation with @Value which is not possible anymore after converting it to a text value.

    Sorry for not mentioning it.


    I appreciate it very much if you vote my Replies as Helpful or Mark as Answer if I could help you out. Thanks!

    Wednesday, June 27, 2012 2:07 PM
  • Okay in that case the option left if to repalce - and -- with some negative numbers 

    Regards
    satheesh

    Wednesday, June 27, 2012 2:09 PM
  • If you are using the result for calculations, then you don't even require the case expression. You can use a COALESCE or ISNULL to change the NULL to 0 and do the calculation. I think this is the best approach than using a character value to represent NULL or 0 as '-' or '--'

    DECLARE @Value INTEGER
    SELECT @Value = NULL
    
    SELECT CAST(COALESCE(@Value, 0) AS DECIMAL(5,2))


    Krishnakumar S

    Wednesday, June 27, 2012 2:28 PM
  • Yes, you can use CONVERT(varchar(20), cast(@Value as decimal(5,2))) 

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    Wednesday, June 27, 2012 5:26 PM
    Moderator
  • Thx for the many answers!

    I finally got it solved!

    my final code:

    CASE 
    	WHEN @Value IS NULL OR @Value = 0
    		THEN '0.00'
    		ELSE CONVERT(VARCHAR(100), (CONVERT(DECIMAL(5,2), (CONVERT(DECIMAL(5,2), @Value) / (1 + (SELECT COUNT(*) FROM Teamuser WHERE FK_Idea = I.ID_Idea))))))
    END AS 'Betrag [JP]'
    


    I appreciate it very much if you vote my Replies as Helpful or Mark as Answer if I could help you out. Thanks!

    Thursday, June 28, 2012 8:32 AM
  • Is this more simple?

    SELECT -- Other select column list...
    	COALESCE(@Value, 0.00) /
    	(1 + (SELECT COUNT(*) FROM Teamuser WHERE FK_Idea = I.ID_Idea))
    FROM 
    --- Remaining statement


    Krishnakumar S

    Thursday, June 28, 2012 8:58 AM