I have a table with 4 fields, the last field is an amount, which can be positive or negative. I want to insert the data from that table in a table that has the same first 3 fields and then 2 amount fields, one for positive, one for negative amounts.
I am trying to use the "Insert Into <new table> (f1, f2, f3, apos, aneg) select f1, f2, f3, a1, a1 from <old table>" syntax.
But I don't know how to specify the fields so that:
- if a1 is positive, then apos = a1, aneg=0
- if a1 is negative, then apos = 0, aneg=a1
Can someone help me with how to achieve what I need ?