I have the following:SELECT SETTDT, total = CASE SECTYPE WHEN 'E' THEN units * [PRICE] WHEN 'S' THEN units * [PRICE] WHEN 'B' THEN units * PRICE / 100 WHEN 'F' THEN units * PRICE / 100 END, SECTYPE, SIDEFROM [sj]
Here is a sample of the output:08/06/07 2315.25000000000 E P08/06/07 1559.25000000000 E P08/06/07 2214.45000000000 E S08/09/07 250000.00000000000 B P08/09/07 250000.00000000000 B P08/09/07 500000.00000000000 B P08/09/07 100000.00000000000 B P08/09/07 350000.00000000000 B P08/09/07 103.50000000000 E P08/09/07 230.00000000000 E P08/09/07 1104.00000000000 E P08/09/07 92.00000000000 E P
What I would like to do is add some logic now that says when its a P for side than multiply the amount * -1 and if its a sale leave as is.