Skip to Content
author's profile photo Former Member
Former Member

selection problem

Experts,

select

T0.DocNum 'AR Invoice Number',

T0.DocDate 'AR Invoice Date',

T0.CardCode,

T0.CardName,

T0.NumAtCard 'Vendor Ref No',

(select sum (T1.Quantity * T1.Price) from INV1 T1 where T1.DocEntry = T0.DocEntry) 'Base Amount',

ISNULL ((select sum (T3.TaxSum) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='1'), 0)'VAT Amount',

ISNULL ((select MAX (T3.TaxRate) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='1'), 0)'VAT %',

ISNULL ((select sum (T3.TaxSum) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='4'), 0)'CST Amount',

ISNULL ((select MAX (T3.TaxRate) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='4'), 0)'CST %',

ISNULL ((select sum (T3.TaxSum) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='5'), 0)'Service Amount',

ISNULL ((select MAX (T3.TaxRate) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='5'), 0)'Service %',

T0.TotalExpns 'Freight Amount',

T0.WTSum 'TDS Amount',

T0.DocTotal 'Document Total'

from OINV T0

where T0.DocDate >= [%0]

and T0.DocDate <= [%1]

The above query in SBO Query manager gives error for the selection critrias

Please help

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2011 at 11:09 AM

    Hi Shruti......

    Try this......

    select T0.DocNum 'AR Invoice Number',
    T0.DocDate 'AR Invoice Date',
    T0.CardCode,
    T0.CardName,
    T0.NumAtCard 'Vendor Ref No',
    (select sum (T1.Quantity * T1.Price) from INV1 T1 where T1.DocEntry = T0.DocEntry) 'Base Amount',
    ISNULL ((select sum (T3.TaxSum) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='1'), 0)'VAT Amount',
    ISNULL ((select MAX (T3.TaxRate) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='1'), 0)'VAT %',
    ISNULL ((select sum (T3.TaxSum) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='4'), 0)'CST Amount',
    ISNULL ((select MAX (T3.TaxRate) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='4'), 0)'CST %',
    ISNULL ((select sum (T3.TaxSum) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='5'), 0)'Service Amount',
    ISNULL ((select MAX (T3.TaxRate) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='5'), 0)'Service %',
    T0.TotalExpns 'Freight Amount',
    T0.WTSum 'TDS Amount',
    T0.DocTotal 'Document Total'
    
    from OINV T0
    where T0.DocDate >= '[%0]'
    and T0.DocDate <= '[%1]'

    Regards,

    Rahul

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      select T0.DocNum 'AR Invoice Number',

      T0.DocDate 'AR Invoice Date',

      T0.CardCode,

      T0.CardName,

      T0.NumAtCard 'Vendor Ref No',

      (select sum (T1.Quantity * T1.Price) from INV1 T1 where T1.DocEntry = T0.DocEntry) 'Base Amount',

      ISNULL ((select sum (T3.TaxSum) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='1'), 0)'VAT Amount',

      ISNULL ((select MAX (T3.TaxRate) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='1'), 0)'VAT %',

      ISNULL ((select sum (T3.TaxSum) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='4'), 0)'CST Amount',

      ISNULL ((select MAX (T3.TaxRate) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='4'), 0)'CST %',

      ISNULL ((select sum (T3.TaxSum) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='5'), 0)'Service Amount',

      ISNULL ((select MAX (T3.TaxRate) from INV4 T3 where T3.DocEntry = T0.DocEntry and T3.StaType='5'), 0)'Service %',

      T0.TotalExpns 'Freight Amount',

      T0.WTSum 'TDS Amount',

      T0.DocTotal 'Document Total'

      from OINV T0

      where T0.DocDate >= '[%0]'

      and T0.DocDate <= '[%1]'

      Can you please give me solution in this query as this is ok as per need.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.