SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Order by
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

JanakiRam
Starting Member

India
22 Posts

Posted - 07/17/2013 :  08:02:52  Show Profile  Reply with Quote
Hi.,

I have a result set

Customer_Ledger_ID Date Payment_Type Payment_Detail_Number Credit Debit
17 07/17/2013 Card XXXX XXXX XXXX 1111 130.00 0
18 07/17/2013 Card XXXX XXXX XXXX 1111 0 130.00
19 07/17/2013 Card XXXX XXXX XXXX 1111 63.17 0
20 07/17/2013 Card XXXX XXXX XXXX 1111 0 63.17
like this
but i need a display set
Customer_Ledger_ID Date Payment_Type Payment_Detail_Number Credit Debit
18 07/17/2013 Card XXXX XXXX XXXX 1111 0 130.00
17 07/17/2013 Card XXXX XXXX XXXX 1111 130.00 0
20 07/17/2013 Card XXXX XXXX XXXX 1111 0 63.17
19 07/17/2013 Card XXXX XXXX XXXX 1111 63.17 0

like this please verify

JanakiRam

edit: moved to proper forum

James K
Flowing Fount of Yak Knowledge

3742 Posts

Posted - 07/17/2013 :  08:11:11  Show Profile  Reply with Quote
quote:
Originally posted by JanakiRam

Hi.,

I have a result set

Customer_Ledger_ID Date Payment_Type Payment_Detail_Number Credit Debit
17 07/17/2013 Card XXXX XXXX XXXX 1111 130.00 0
18 07/17/2013 Card XXXX XXXX XXXX 1111 0 130.00
19 07/17/2013 Card XXXX XXXX XXXX 1111 63.17 0
20 07/17/2013 Card XXXX XXXX XXXX 1111 0 63.17
like this
but i need a display set
Customer_Ledger_ID Date Payment_Type Payment_Detail_Number Credit Debit
18 07/17/2013 Card XXXX XXXX XXXX 1111 0 130.00
17 07/17/2013 Card XXXX XXXX XXXX 1111 130.00 0
20 07/17/2013 Card XXXX XXXX XXXX 1111 0 63.17
19 07/17/2013 Card XXXX XXXX XXXX 1111 63.17 0

like this please verify

JanakiRam

What is the rule that you want to use in the new ordering scheme? I can see that in the original ordering scheme, Customer_Ledger_ID was used. But, I cannot discern any pattern to the new ordering scheme.
Go to Top of Page

JanakiRam
Starting Member

India
22 Posts

Posted - 07/17/2013 :  08:16:19  Show Profile  Reply with Quote
quote:
Originally posted by James K

quote:
Originally posted by JanakiRam

Hi.,

I have a result set

Customer_Ledger_ID Date Payment_Type Payment_Detail_Number Credit Debit
17 07/17/2013 Card XXXX XXXX XXXX 1111 130.00 0
18 07/17/2013 Card XXXX XXXX XXXX 1111 0 130.00
19 07/17/2013 Card XXXX XXXX XXXX 1111 63.17 0
20 07/17/2013 Card XXXX XXXX XXXX 1111 0 63.17
like this
but i need a display set
Customer_Ledger_ID Date Payment_Type Payment_Detail_Number Credit Debit
18 07/17/2013 Card XXXX XXXX XXXX 1111 0 130.00
17 07/17/2013 Card XXXX XXXX XXXX 1111 130.00 0
20 07/17/2013 Card XXXX XXXX XXXX 1111 0 63.17
19 07/17/2013 Card XXXX XXXX XXXX 1111 63.17 0

like this please verify

JanakiRam

What is the rule that you want to use in the new ordering scheme? I can see that in the original ordering scheme, Customer_Ledger_ID was used. But, I cannot discern any pattern to the new ordering scheme.


I need to show first Debit Value so need the second result set

JanakiRam
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3742 Posts

Posted - 07/17/2013 :  08:29:27  Show Profile  Reply with Quote
How do you associate the two first two rows together? Is there any other column that tells you that the first two rows are a pair and the second two rows are another pair? Granted, the credit value of one is equal to the debit value of the other. But couldn't there be many transactions with the exactly identical credit values?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000