Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
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 credittnx...
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 columnsselect ... credit = value, debit = convert(decimal(18,2), null), .... from creditentriesunion allselect ... 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.