Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 help

Author  Topic 

twinklestar0802
Starting Member

17 Posts

Posted - 2005-05-22 : 06:56:38
guys, i need ur help agen... hehe... i am going to make an accounts payable subsidiary ledger... i combine values from my credit memo(credit) and credit invoice(debit).... i am planning to union them and it worked.. however, credit n debit are at the same column.. i want credit to be on the right side n debit on the left side.. how can i do that? its like this:

date debit credit

tnx...

nr
SQLTeam MVY

12543 Posts

Posted - 2005-05-22 : 13:28:05
I presume you still want them in seperate rows so a join won't work - and you presumably don't have any fields to join on.
in your union just place the values in seperate columns
select ... credit = value, debit = convert(decimal(18,2), null), .... from creditentries
union all
select ... credit = null, debit = value, .... from debitentries



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

twinklestar0802
Starting Member

17 Posts

Posted - 2005-05-22 : 23:14:57
tnx....
Go to Top of Page
   

- Advertisement -