Results 1 to 2 of 2

Thread: Specific record want to show specific below the row

  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Specific record want to show specific below the row

    Dear All,

    Dear Freind,

    I tried following queary and get the following output.

    Queary:

    select DocEntry,AbsId,Name,TaxAmount from
    (
    select I4.DocEntry,MAX(ot.AbsId) as AbsId, oa.Name, sum(I4.TaxSum) as TaxAmount
    from inv4 I4
    left join ostt ot on ot.AbsId = I4.StaType
    left join osta oa on I4.StaCode = oa.Code
    where I4.DocEntry = '91'
    group by oa.Name,I4.DocEntry

    union all

    select i2.DocEntry,i2.ExpnsCode As AbsId,ox.ExpnsName As Name,i2.LineTotal As TaxAmount from inv2 i2
    left join oexd ox on ox.ExpnsCode = i2.ExpnsCode
    where i2.DocEntry in (select DocEntry from inv4 where DocEntry = '91')
    )t order by AbsId

    Output :

    91 1 Packing Charges 2316.000000
    91 2 Transportion Charge 3937.000000
    91 7 Excise 30605.940000
    91 8 ECESS 612.120000
    91 9 HCESS 306.060000
    91 13 OCTROI 10655.430000
    91 14 OCT_SER 106.560000
    91 15 VAT_4 14091.300000

    Now i want show second entry(Transportation Charge) before OCTROI.
    Can we show the specific entry below the specific row.
    Can u plz tell me how to this ?
    I want following output,

    91 1 Packing Charges 2316.000000
    91 7 Excise 30605.940000
    91 8 ECESS 612.120000
    91 9 HCESS 306.060000
    91 2 Transportion Charge 3937.000000
    91 13 OCTROI 10655.430000
    91 14 OCT_SER 106.560000
    91 15 VAT_4 14091.300000


    Harish Patil

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Is there any logic for ordering?. Can you use ORDER BY on a combination of columns?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •