I have a table that is basically:
Year, Month,Co, Division, GL account, amount (+ or -)
It is a detail transaction table.
I want to create a trial balance from this, which will list the debits (positives) in one column and credits (negatives) in a second column. It would also need to sum by, for this report, division + account (there is only one company).
Can this be done with an SQL query? I am using an SQL tool to read the db file directly.
Output might be:
Year Co Division Account Debit Credit
----- -- -------- ------- ----- ------
2010 1 100 1111 $125 ($100)
2010 1 100 4000 $10 ($2,000)
2010 1 105 4000 $15 ($1,500)
I would also like a sum column on the right that sums debits and credits for the division+account combo.
Possible?
Ideally, I would have the results in this format. I know I could create a union or do something in Excel / Access / Crystal to get it this way...but I want the extract to be in this format if possible.
Year, Month,Co, Division, GL account, amount (+ or -)
It is a detail transaction table.
I want to create a trial balance from this, which will list the debits (positives) in one column and credits (negatives) in a second column. It would also need to sum by, for this report, division + account (there is only one company).
Can this be done with an SQL query? I am using an SQL tool to read the db file directly.
Output might be:
Year Co Division Account Debit Credit
----- -- -------- ------- ----- ------
2010 1 100 1111 $125 ($100)
2010 1 100 4000 $10 ($2,000)
2010 1 105 4000 $15 ($1,500)
I would also like a sum column on the right that sums debits and credits for the division+account combo.
Possible?
Ideally, I would have the results in this format. I know I could create a union or do something in Excel / Access / Crystal to get it this way...but I want the extract to be in this format if possible.