title: Using case in a sql select statement
body: <p>Consider a table with a column amount,</p>
  
  <pre><code>Amount
  -1235.235
  1356.45
  -133.25
  4565.50
  5023
  -8791.25
  </code></pre>
  
  <p>I want to my result pane to be like this,</p>
  
  <pre><code>Debit   Credit
    0     -1235.235
  1356.45  0 
    0     -133.25
  </code></pre>
  
  <p>Here is my stored procedure,</p>
  
  <pre><code>USE [HotelBI_CustomDB]
  GO
    SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  
  ALTER PROCEDURE [dbo].[SP_GetJVReport](
  @p_FromDate datetime,
  @p_ToDate datetime
  )
  AS
  BEGIN
  select jv.AccountNo,jv.AccountNoTitle,(select JV_GroupsHead.GroupTitle
      from JV_GroupsHead where JV_GroupsHead.Id=jv.GroupId) as 'GroupName'
  ,jv.Revenue --" This column i need to check and have to split it into two 
                 column "credeit,debit""
  
  from JVFunction1(@p_FromDate,@p_ToDate) as jv
  
  END
  </code></pre>
  
  <p>How to write a select statement such that it uses a case like amount>=0 as credit and amount &lt;0 as debit? </p>