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.
Author |
Topic |
RoniDxb
Starting Member
28 Posts |
Posted - 2008-08-05 : 06:52:51
|
Table CustLedgerAccNo.....VisaRecDate..PpNo....Price..PaymentDate..PaymentNo..AmtRec.001-0002..Null..........Null....Null.2008-08-03....5........3000001-0002..2008-08-01...AB1012..1500...Null.........Null.......Null.001-0002..2008-08-01...AB1012..1500...Null.........Null.......Null.001-0001..2008-08-02...AB1012..1500...Null.........Null.......Null.001-0002..2008-08-01...AB1012..1500...Null.........Null.......Null.001-0002..2008-08-04...AB1012..1500...Null.........Null.......Null.001-0002..2008-08-03...AB1012..1500...Null.........Null.......Null.I want to select recods with respect to AccountNo Order by VisaRecDate and PaymentDate for example if i select record w.r.t AccountNo 001-0002,result should be like thisAccNo.....VisaRecDate..PpNo....Price..AmtRec..Descriptions001-0002..2008-08-01...AB1012..1500...Null....Null..........001-0002..2008-08-01...AB1012..1500...Null....Null.........001-0002..2008-08-01...AB1012..1500...Null....Null..........001-0002..2008-08-03...AB1012..1500...Null....Null..........001-0002..Null.........Null....Null...3000..PmtDate 2008-08-03,Pmt#5001-0002..2008-08-04...AB1012..1500...Null....Null.........plz guide mePlz note in result 3000 value is in AmtRec colbcoz of formatting problem it does not look at its actual position |
|
Jim77
Constraint Violating Yak Guru
440 Posts |
Posted - 2008-08-05 : 11:08:32
|
Order by VisaRecDate,PaymentDate desc |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-05 : 13:40:27
|
order by coalesce(VisaRecDate,PaymentDate) |
 |
|
RoniDxb
Starting Member
28 Posts |
Posted - 2008-08-05 : 14:55:45
|
quote: Originally posted by visakh16 order by coalesce(VisaRecDate,PaymentDate)
Yes thanks Visakh ,It works successfully. |
 |
|
|
|
|