title: Cannot call method in decimal SQL Server error
body: <p>Here is my query with left join and I am automatically developing credit debit and balance.</p>
  
  <p>Perhaps I am lacking upon column. I used <code>gl_drcr</code> as main column and split it by query into credit and debit but I am unable to get value of balance. I have column of amount also, where I can store amount values.</p>
  
  <p>Can you help me to sort out where my fault is in this query?</p>
  
  <p>My stored procedure looks like this:</p>
  
  <pre><code>ALTER procedure [dbo].[sp_getDataML]
      (@gl_acid int, @userid int)
  AS
  BEGIN
      SELECT 
          ROW_NUMBER() OVER (ORDER BY gLedeger.PK_id) AS sno,
          CASE 
             WHEN master.ma_accname IS NULL THEN '' 
             ELSE ma_accname 
          END AS AccName, 
          gLedeger.gl_date AS date, gLedeger.gl_narration AS Narration, 
          gLedeger.gl_drcr as DRCR,
          CASE
             WHEN gLedeger.gl_drcr &gt; 0 THEN ABS(gLedeger.gl_drcr) 
             ELSE 0.00 
          END AS debit,
          CASE 
             WHEN gLedeger.gl_drcr &lt; 0 THEN ABS(gLedeger.gl_drcr) 
             ELSE 0.00 
          END AS credit,
          SUM(COALESCE(gLedeger.gl_drcr.credit, 0) - COALESCE(gLedeger.gl_drcr.debit, 0)) AS Balance  
      FROM 
          gLedeger   
      LEFT JOIN 
          master ON gLedeger.GL_ACID = master.PK_ID 
      LEFT JOIN
          registration r ON master.userId = @userid
      WHERE 
          gLedeger.GL_ACID = @gl_acid
          /*and LEFT(gLedeger.gl_voucher,2)=@voucher*/
      ORDER BY 
          gLedeger.gl_date
  END
  </code></pre>