views:

318

answers:

1

im using asp.net crystal report and this is sql query CONVERT(NUMERIC(8, 2), CASE WHEN CASE WHEN GLDD_DOC_AMOUNT > 0 THEN GLDD_DOC_AMOUNT ELSE 0 END = 0 THEN NULL ELSE CASE WHEN GLDD_DOC_AMOUNT > 0 THEN GLDD_DOC_AMOUNT ELSE 0 END END) Q3_DR, CONVERT(NUMERIC(8, 2), CASE WHEN (- 1 * CASE WHEN GLDD_DOC_AMOUNT < 0 THEN GLDD_DOC_AMOUNT ELSE 0 END) = 0 THEN NULL ELSE - 1 * CASE WHEN GLDD_DOC_AMOUNT < 0 THEN GLDD_DOC_AMOUNT ELSE 0 END END) Q3_CR,

i want to write this query into crystal report sql expression field how can i convert this?

A: 

There are two expressions listed, SQL expression code for each is

q3_dr :

case when GLDD_DOC_AMOUNT > 0 then GLDD_DOC_AMOUNT end

q3_cr :

case when GLDD_DOC_AMOUNT < 0 then -GLDD_DOC_AMOUNT end

paulash