Version: 19
When presenting information from the database with EZWriter, sometimes information needs to be displayed as certain way depending on the data which is returned from the database. Using the SQL CASE statement can help to achieve this.
Example:
SELECT
CASE WHEN AR030_AMT < 0 THEN 'C'+LOWER('REDIT ') + 'N' + LOWER('OTE') ELSE 'I'+LOWER('NVOICE') END AS [Invoice Type]
FROM AR030_INVOICE_REGISTER
Will Return
Credit Note as the invoice type when the amount of the invoice is negative otherwise the invoice type will be Invoice
Comments
0 comments
Please sign in to leave a comment.