>>How do I put this in SQL syntax:
>>
>>
>>IIF(((TRANCODE="PR") .OR. (TRANCODE = "PT" .AND. TRANQUANT > 0)),TRANQUANT,0) AS Recepit
>>
>
>CASE WHEN (((TRANCODE="PR") .OR. (TRANCODE = "PT" .AND. TRANQUANT > 0)) THEN TRANQUANT ELSE 0 END
SQL doesn't like the 'OR's and 'AND's
I tried this, but it still doesn't like the 'OR'. (Field names are different in the new DB)
CASE tr.sTrans_Type_CD
WHEN 'PR' THEN tr.decTrans_Qty
WHEN ('PT' AND tr.decTrans_Qty > 0) THEN tr.decTrans_Qty
ELSE 0
END AS Receipt
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people