title: Linq Select if vb.net
body: <p>I have an dollar amount in my database column. I can get it to place the data in a column based on whether or not the amount is negative or positive, but it produces "0.00" in the False column. How do I get it to leave that column blank?</p>
  
  <p>The code that I have is as follows.</p>
  
  <pre><code>Dim query = From t In ds.HNBSavings
                  Order By t.Date Descending, t.Id Descending
                  Select t.Id, t.Date, t.Desc, Debit = If(t.Amount &gt;= 0, t.Amount, 0), Credit = If(t.Amount &lt; 0, t.Amount, 0)
  
  dgBank.ItemsSource = query.ToList()
  </code></pre>
  
  <p>So the results are 5.0000 under debits if it's positive and 0.0000 under credits the functionality works, but the results are a little difficult to read.</p>
  
  <p>I have tried changing the false declaration to Null, and it works but returns a 1.0000 in the false column. 
  Changed it to empty string " ".ToString(), but get a runtime exception. </p>
  
  <p>Thanks for the help in advance.</p>