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

Base Price and Special Price Query

Hi,,

I need a Query where the results will be Item Code, Base Price(Item Cost) and Special Price from where I will calculate Profit Amount ,conditions being Price List, Warehouse(For Item Cost),Customer Code(Item master UDF).Special Price should be the least Price of the Quantity Scale Special Price (ex,for 100 qty price-10 rs,120qty -8rs,130qty-7rs.The Special price of the query should be 7rs.)

Thanks and Regards,

S.G.Sekar

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 02, 2013 at 05:51 AM

    Hi,

    Try this query:

    SELECT T0.[DocNum], T2.[CardCode], T1.[Price], T3.[AvgPrice] FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry left join OSPP T2 on t2.itemcode = t1.itemcode and t2.cardcode = t0.cardcode INNER JOIN OITM T3 ON T1.ItemCode = T3.ItemCode INNER JOIN OITW T4 ON T3.ItemCode = T4.ItemCode WHERE T2.[ListNum] = [%0] and T4.[WhsCode] = [%1] and T2.[CardCode] = [%2]

    Thanks & Regards,

    Nagarajan

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      Try this query:

      SELECT T0.[CardCode], T2.[ItemCode], T2.[ItemName], T2.[AvgPrice], T1.[Amount], min(T1.[Price]) FROM OSPP T0 left join SPP2 T1 on t0.itemcode = t1.itemcode left JOIN OITM T2 ON T0.ItemCode = T2.ItemCode left JOIN OITW T3 ON T2.ItemCode = T3.ItemCode WHERE T0.[ListNum] = [%0] and T3.[WhsCode] = [%1] and T0.[CardCode] = [%3] GROUP BY T0.[CardCode], T2.[ItemCode], T2.[ItemName], T2.[AvgPrice], T1.[Amount] having min(T1.[Price]) <=70

      Thanks & Regards,

      Nagarajan

  • Posted on Dec 03, 2013 at 05:15 AM

    Hi Sekar

    Find the query below

    SELECT T0.[DocNum], T0.[CardCode],T1.[Price], T1.[Quantity],

    CASE when T1.[Quantity] = '100' then '100'

    when T1.[Quantity] = '200' then '80'

    when T1.[Quantity] >= '300' then '70' else T1.[Price] End as 'Spcl Price',

    T1.[Price], T3.[AvgPrice]

    FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry

    left join OSPP T2 on t2.itemcode = t1.itemcode and t2.cardcode = t0.cardcode

    INNER JOIN OITM T3 ON T1.ItemCode = T3.ItemCode

    INNER JOIN OITW T4 ON T3.ItemCode = T4.ItemCode

    WHERE T2.[ListNum] = '[%0]' and T4.[WhsCode] = '[%1]' and T2.[CardCode] = '[%2]'



    Regards

    Jenny

    Add a comment
    10|10000 characters needed characters exceeded

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.