TO onhand in month

Dear Experts,
SELECT T0.ItemCode, T0.Dscription,T1.OnHand, SUM(T0.BaseQty*T1.NumInSale) AS 'Qty Sales',DAY(GetDate()) as 'Days',
Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END AS 'Total days'
,(t1.onhand/(SUM(T0.BaseQtyT1.NumInSale)/DAY(GetDate()) Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END))AS 'TURN OVER IN MONTH'
FROM DBO.INV1 T0 INNER JOIN DBO.OITM T1 ON T0.ItemCode = T1.ItemCode
WHERE Month(T0.DocDate) = Month(GetDate()) AND Year(T0.DocDate) = Year(GetDate())
AND (T0.BaseQty*T1.NumInSale)>0
GROUP BY T0.ItemCode,T0.Dscription,T1.OnHand
ORDER BY T0.ItemCode
how to write query that displays all of the stock sold and Onhand not sold. because this query to display the items sold this month.
Thanks for your help

Hi Expert,
how to write query that displays
Turn Over Days.., i try the query :
SELECT T0.ItemCode, T0.Dscription,T1.OnHand, SUM(T0.BaseQtyT1.NumInSale) AS 'Qty Sales',DAY(GetDate()) as 'Days', ((T1.[OnHand] /  (SUM(T0.BaseQtyT1.NumInSale)/DAY(GetDate())* Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END))AS 'TURN OVER IN MONTH' )*30) AS 'TO HARI',
Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END AS 'Total days'
,(t1.onhand/(SUM(T0.BaseQtyT1.NumInSale)/DAY(GetDate()) Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END))AS 'TURN OVER IN MONTH'
FROM DBO.INV1 T0 INNER JOIN DBO.OITM T1 ON T0.ItemCode = T1.ItemCode
WHERE Month(T0.DocDate) = Month(GetDate()) AND Year(T0.DocDate) = Year(GetDate())
AND (T0.BaseQty*T1.NumInSale)>0
AND (T1.[OnHand]*T1.NumInSale)>0
GROUP BY T0.ItemCode,T0.Dscription,T1.OnHand
ORDER BY T0.ItemCode
the syntax is incorrect syntax the keyword 'AS'
statement service contracts (OCDR) (s) Could not beprepared
Hope for your immediate response
thanks

Similar Messages

  • Item Query by onhand/QTY Sold in last week/month/QTY

    I am trying to create a query showing items that are in a particular warehouse and then how many of that item has been sold over the last week/month/quarter.
    I have got the following query started,but i am unsure to group can anyone help with this
    SELECT T0.[ItemCode], T0.[ItemName],T1.[OnHand],   T0.[IsCommited],  T0.[MaxLevel], T0.[MinLevel], T2.[Quantity]
    FROM [dbo].[OITM]  T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode INNER JOIN INV1 T2 ON T0.ItemCode = T2.ItemCode
    WHERE T1.[WhsCode] = '01'

    I am trying to create a query showing items that are in a particular warehouse and then how many of that item has been sold over the last week/month/quarter.
    I have got the following query started,but i am unsure to group can anyone help with this
    SELECT T0.[ItemCode], T0.[ItemName],T1.[OnHand],   T0.[IsCommited],  T0.[MaxLevel], T0.[MinLevel], T2.[Quantity]
    FROM [dbo].[OITM]  T0 INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode INNER JOIN INV1 T2 ON T0.ItemCode = T2.ItemCode
    WHERE T1.[WhsCode] = '01'

  • Daily, Monthly, and Yearly Report

    Hi I am new to the BAM. I have a BPM process. I want to generate the daily, monthly and yearly report for it. Please advise how can I achieve it. I have a one dimension variable on the process.
    Thanks in advance!

    Hi,
    Try this query to get default ware house and its quantity and modify above query.
    SELECT T0.[ItemCode], T0.[WhsCode], T0.[OnHand] FROM OITW T0  INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode WHERE T0.[WhsCode] =  T1.[DfltWH] and  T1.[ItemCode]  = [%0]
    Thanks & Regards,
    Nagarajan

  • "how to use Query include one month "

    Hi all expert,
    How to make a request how to add table "QTYSALES one month yesterday"
    so that I can compare with this month.
    Query me this:
    SET ARITHABORT OFF
    SET ANSI_WARNINGS OFF
    SELECT T0.ItemCode, T0.Dscription,T1.OnHand, convert(varchar,SUM(T0.BaseQty*T1.NumInSale)) AS 'Qty Sales',DAY(GetDate()) as 'Days',
    Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END AS 'Total days'
    ,convert (varchar,(t1.onhand/(SUM(T0.BaseQtyT1.NumInSale)/DAY(GetDate()) Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END)))AS 'TURN OVER IN MONTH'
    ,round(convert (varchar,(t1.onhand/(SUM(T0.BaseQtyT1.NumInSale)/DAY(GetDate()) Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END))),4)* 30 AS 'Turn Over Days'
    FROM DBO.INV1 T0 INNER JOIN DBO.OITM T1 ON T0.ItemCode = T1.ItemCode
    WHERE Month(T0.DocDate) = Month(GetDate()) AND Year(T0.DocDate) = Year(GetDate())
    GROUP BY T0.ItemCode,T0.Dscription,T1.OnHand
    union
    SELECT T1.ItemCode, T1.itemname,T1.OnHand, '' AS 'Qty Sales',DAY(GetDate()) as 'Days',
    Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END AS 'Total days'
    ,'No Sales' AS 'TURN OVER IN MONTH'
    ,NULL
    FROM DBO.OITM T1
    WHERE T1.ITEMCODE NOT IN (SELECT ISNULL(ITEMCODE,0) FROM INV1)
    GROUP BY T1.ItemCode,T1.itemname,T1.OnHand
    ORDER BY 1
    thanks for all
    Edited by: rachelhel on May 20, 2009 8:06 AM

    haiiii allll pls help...thankss
    Hi consulatant B1
    How to use Query
    My goal is to create a table to see * The number of sales in a month yesterday *
    I want to make a request showing the amount of sales at the end of the month.
    For example this month is on May 25, so I want to show the Quantity of one month April 25
    I have tried several times, but still just wrong.
    I need expert help to solve the problem for me.
    thanks

  • Help with supply and demand query using monthly buckets

    I'm working on a query bound for Discoverer which pulls the aggregated supply and demand for an item and buckets it into months. So for any given item, I need to show the item, onhand, cost, aggregated supply (planned orders, requisitions, pos), and aggregated demand (planned order demand, jobs) - all bucketed by months.
    The code below works okay to find all of the data for July, but I also need to show August and September. I'm thinking I could use a union but am reluctant because the query already runs kind of slow and I'm not sure if I'm on the right track.
    Database Server
    RDBMS : 10.2.0.3.0
    Oracle Applications : 11.5.9
    -Tracy
    select
          item.inventory_item_id, item.organization_code, item.item, item.description
        , item.make_buy,item.planner_code
        , planned.compile_designator, planned.order_type_text, sum(planned.quantity_rate)planned_total
        , planned.mrp_sugg_due_month
        , sum(job.required_quantity-job.quantity_issued)job_open, job.required_month
        , onhand.total_qoh
        , purchase.item_revision prev, purchase.promised_month, purchase.ship_to_organization_id 
        , sum((purchase.quantity-purchase.quantity_cancelled)-purchase.quantity_received)po_open  
        , req.item_revision rrev, req.destination_organization_id, req.org_id, req.need_by_month
        , sum((req.quantity-req.quantity_cancelled)-req.quantity_delivered)req_open
        , cost.item_cost,cost.cost
    from
    --item--
    (select mtl.inventory_item_id, mtl.segment1 item,mtl.description,decode(mtl.planning_make_buy_code,1,'Make',2,'Buy') make_buy
            ,mtl.organization_id, mtp.organization_code, mtl.planner_code
           ,to_char(add_months(sysdate,+1),'YYYY_MM')month1, to_char(add_months(sysdate,+2),'YYYY_MM')month2
           ,to_char(add_months(sysdate,+3),'YYYY_MM')month3
    from    inv.mtl_system_items_b mtl, inv.mtl_parameters mtp
    where    mtl.organization_id = mtp.organization_id
    )item,
    --planned orders - 3 months --
    (select compile_designator,organization_id,inventory_item_id,order_type_text,nvl(quantity_rate,0)quantity_rate,new_due_date
           ,to_char(trunc(new_due_date,'MM'),'YYYY_MM')mrp_sugg_due_month
    from   apps.mrp_orders_sc_v
    where  order_type_text in ('Planned order','Planned order demand')
    and    to_char(trunc(new_due_date,'MM'),'YYYY_MM') <= to_char(add_months(:Month,+2),'YYYY_MM')
    and    to_char(trunc(new_due_date,'MM'),'YYYY_MM') >=  to_char(:Month,'YYYY_MM')
    )planned,
    --jobs - 3 months--
    (select organization_id,wip_entity_name job, inventory_item_id,concatenated_segments,nvl(required_quantity,0)required_quantity
            ,nvl(quantity_issued,0)quantity_issued, date_required,to_char(trunc(date_required,'MM'),'YYYY_MM') required_month
            ,wip_entity_id,creation_date, wip_job_status
    from    apps.wip_requirement_ops_inq_v
    where   primary_item_id <>inventory_item_id
    and     wip_job_status not in ('Closed','Cancelled','Complete')
    and     to_char(trunc(date_required,'MM'),'YYYY_MM') <= to_char(add_months(:Month,+2),'YYYY_MM')
    and     to_char(trunc(date_required,'MM'),'YYYY_MM') >= to_char(:Month,'YYYY_MM')
    )job,
    --qty onhand--
    (select  inventory_item_id,organization_id,sum(nvl(transaction_quantity,0))total_qoh
    from     inv.mtl_onhand_quantities_detail
    group by inventory_item_id, organization_id
    )onhand,
    -- po - 3 months--
    (select pol.item_id, pol.item_revision, nvl(pll.quantity,0)quantity, nvl(pll.quantity_received,0)quantity_received
          , nvl(pll.quantity_rejected,0),nvl(pll.quantity_cancelled,0)quantity_cancelled,poh.segment1 po_num
           ,pll.promised_date, to_char(trunc(pll.promised_date,'MM'),'YYYY_MM')promised_month
           ,pll.shipment_num,pll.ship_to_organization_id 
    from   po.po_lines_all pol, po.po_headers_all poh, po.po_line_locations_all pll
    where  poh.po_header_id = pol.po_header_id
    and    pol.po_header_id = pll.po_header_id
    and    pol.po_line_id = pll.po_line_id
    and    pol.cancel_flag != 'Y'
    and    pol.item_id is not null
    and    to_char(trunc(pll.promised_date,'MM'),'YYYY_MM')<= to_char(add_months(:Month,+2),'YYYY_MM')
    and    to_char(trunc(pll.promised_date,'MM'),'YYYY_MM')>=  to_char(:Month,'YYYY_MM')
    )purchase,
    --reqs - 3 months--
    (select prh.segment1 req_number,nvl(prl.quantity,0)quantity,nvl(prl.quantity_delivered,0)quantity_delivered
           ,nvl(prl.quantity_cancelled,0)quantity_cancelled
           ,prl.destination_organization_id,prl.org_id,prl.item_id,prl.item_revision,prl.need_by_date
           ,to_char(trunc(prl.need_by_date,'MM'),'YYYY_MM')need_by_month
    from   po.po_requisition_headers_all prh, po.po_requisition_lines_all prl
    where  prh.requisition_header_id = prl.requisition_header_id(+)
    and    nvl(prl.cancel_flag,'N') !='Y'
    and    prh.authorization_status != 'CANCELLED'
    and    to_char(trunc(prl.need_by_date,'MM'),'YYYY_MM') <= to_char(add_months(:Month,+2),'YYYY_MM')
    and    to_char(trunc(prl.need_by_date,'MM'),'YYYY_MM') >=  to_char(:Month,'YYYY_MM')
    )req,
    --cost--
    (select msib.inventory_item_id,msib.organization_id,cqm.material_cost,cic.item_cost
    ,(case when cqm.material_cost=0 then cic.item_cost else cqm.material_cost end) cost, cqm.cost_group_id
    from inv.mtl_system_items_b msib
         ,(select cql.cost_group_id,cql.inventory_item_id,cql.organization_id,cql.layer_quantity,cql.material_cost,mp.organization_code
             from bom.cst_quantity_layers cql, inv.mtl_parameters mp
            where mp.default_cost_group_id = cql.cost_group_id) cqm
        ,bom.cst_item_costs cic
    where msib.inventory_item_id = cqm.inventory_item_id(+)
    and msib.organization_id = cqm.organization_id(+)
    and msib.inventory_item_id = cic.inventory_item_id(+)
    and msib.organization_id = cic.organization_id(+)
    )cost
    where item.inventory_item_id = job.inventory_item_id(+)
    and   item.organization_id = job.organization_id(+)
    and   item.month1 = job.required_month(+)  -- 2009_07 --
    and   item.inventory_item_id = onhand.inventory_item_id(+)
    and   item.organization_id = onhand.organization_id(+)
    and   item.inventory_item_id = purchase.item_id(+)
    and   item.month1 = purchase.promised_month(+)  -- 2009_07 --
    and   item.inventory_item_id = req.item_id(+)
    and   item.month1 = req.need_by_month(+)  -- 2009_07 --
    and   item.inventory_item_id = cost.inventory_item_id(+)
    and   item.organization_id = cost.organization_id(+)
    and   item.inventory_item_id = planned.inventory_item_id(+)
    and   item.organization_id = planned.organization_id(+)
    and   item.month1 = planned.mrp_sugg_due_month(+)  -- 2009_07 --
    and   item.make_buy = 'Buy'
    and   item.item in ('161309040','744L755','150-GFM') --test items --
    group by item.inventory_item_id,item.organization_code,item.item,item.description,item.make_buy,item.planner_code
          ,job.required_month ,onhand.total_qoh , purchase.item_revision,  purchase.promised_month
            ,purchase.ship_to_organization_id  ,cost.item_cost,cost.cost
           ,req.item_revision, req.destination_organization_id,req.org_id,req.need_by_month
           ,planned.compile_designator,planned.order_type_text,planned.mrp_sugg_due_month
    order by item.organization_code,item.item

    Hi,
    Six things:
    (1) Where are the one-to-many relationships between your tables? If a single row in mtl can match two (or more) rows in mrp, and can also match two (or more) rows in wip, then it looks like, when you join both of them them, you'll have a chasm trap, that is, you'll get all the matching rows from mrp paired with all matching rows from wip. Are you sure your existing query is producing the right results?
    Are there one-to-many relationships with the other tables in your original query?
    (2) Are your DATEs always at midnight? If not, avoid using BETWEEN and LAST_DAY for DATE comparisons: otherwise you'll miss everything between 00:00:01 and 23:59:59 on the last day.
    That is, instead of
    and     mrp.new_due_date(+) BETWEEN :Month AND LAST_DAY(ADD_MONTHS(:Month,2))ypou should say
    and       mrp.new_due_date (+)     >= :Month
    and       mrp.new_due_date (+)     <  ADD_MONTHS (:Month, 3)(3) The basic way to pivot the months of mrp_due_date is:
    SELECT    ...
    ,       NVL ( SUM ( CASE
                     WHEN  mrp.new_due_date >= :month
                     AND   mrp.new_due_date < ADD_MONTHS (:month, 1)
                     THEN  mrp.quantity_rate
                    END
               , 0
               )          AS mrp_qty_0
    ,       NVL ( SUM ( CASE
                     WHEN  mrp.new_due_date >= ADD_MONTHS (:month, 1)
                     AND   mrp.new_due_date <  ADD_MONTHS (:month, 2)
                     THEN  mrp.quantity_rate
                    END
               , 0
               )          AS mrp_qty_1When you do this, do not GROUP BY TRUNC (mrp.new_due_date, 'MM').
    The code above does two months: I'm sure you get the idea for how to do more.
    To get dynamic column headings (such as Jun_2009 or "2009-06" instead of the generic mrp_qty_o) requires dynamic SQL. The best way to do dynamic SQL depends on the tool that is producing the query (e.g. SQL*Plus). What are you using? Are you willing to change, if it helps?
    (4) Displaying separate columns from one row as a single column on multiple rows is called unpivoting. How badly do you want to do that? Your query would be simpler and faster if the output had only one row per group (rather than one row for mrp_qty and another row for wip_wty). That one row could have six columns (e.q. June_mrp, June_wip, July_mrp, July_wip, August_mrp and August_wip) instead of three. Depending on your front-end tool, you might even be able to wrap the single row of output so that it always appeared as two rows, each with three columns.
    (5) Sorry I told you to do
    and     mrp.order_type_text(+) in (...)I never use the + outer-join notation any more, so I forgot about the ORA-01719 error. There's no problem having an outer-join condition like that using ANSI notation. (One more reason to switch.)
    (6) As you noticed, this site doesn't like to print the &lt;&gt; inequality operator, even inside tags.
    Use the equivalent != operator instead, when posting on this site.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Inventory onhand cube

    Hi Gurus,
    the Business requirement for us is to give the users a Onhand report on a monthly basis, my question to you guys is
    Instead of building a Onhand cube at month level can I build a cube at the daily level and build an aggregate on top of the cube at monthly level and have a report on it? Just thinking about the future if they ask inventory onhand report at the daily level.
    I know it is little different in case of inventory cube and how it works because of the validity table and the performance issues
    if we have at daily level? Is it possible please through some input on this.
    Thanks
    Jay.

    Hi,
    Use 2LIS_03_BX, 2LIS_03_BF, 2LIS_03_UM to 0IC_C03 Cube and design the report.
    You can do it by using 0IC_C03 InfoCube, see the report design steps and keyfigures used.
    Use :
    0VALSTCKVAL   " for Value
    0VALSTCKQTY   " for Qty
    0CALMONTH        " for Month
    Use the above combinations in New Selections in columns and go it.
    For Qty Opening:
    New Selection bad drag abd drop following things
    0VALSTCKQTY   " for Qty
    0CALMONTH        " for Month and restrict with less then or equalto option variable (single value, user input)  and set the offeset
                                   value = -1 bcoz if user will give 12.2009 , so it will display 11.2009 closing stock, this is opening for 12.2009.
    For Qty Closing:
    New Selection bad drag abd drop following things
    0VALSTCKQTY   " for Qty
    0CALMONTH        " for Month and restrict with less then or equalto option variable (single value, user input) .
    In the same way build for Value and other Keyfigures on 0IC_C03.
    And
    Drag & drop
    0MATERAIL
    0PLANT  " Give some Input Variable.
    See the steps.
    Treatment of historical full loads with Inventory cube
    Setting up material movement/inventory with limit locking time
    If it is BI 7 then for BX in in DTP in Extraction Tab you need to select Extacrion mode = NON-Cumulative option.
    Thanks
    Reddy

  • Qty sales & month

    Dear Forums,
    If i want to get this report for This month so far ;
    item code, item description, DocDate,stock on hand, Qty sales, Turn over, Turn over days
    eg . April 20,
    542514 / MILK/ 11-05-09 / 40 / 10 / 2.66666 / 80 / 20 / 30
    542518/ SOAP/ 11-05-09 / 40/ 10 / 2.66666 / 80 / 20 / 30
    can any one show me the query? thanks
    Edited by: rachelhel on Apr 22, 2009 7:48 AM
    Edited by: rachelhel on Apr 22, 2009 10:38 AM

    Hi ,
    Please try this .....
    SET ARITHABORT OFF SET ANSI_WARNINGS OFF
    SELECT T0.ItemCode, T0.Dscription,T1.OnHand, convert(varchar,SUM(T0.BaseQty*T1.NumInSale)) AS 'Qty Sales',DAY(GetDate()) as 'Days',
    Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END AS 'Total days'
    ,convert (varchar,(t1.onhand/(SUM(T0.BaseQty*T1.NumInSale)/DAY(GetDate())* Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END)))AS 'TURN OVER IN MONTH'
    FROM DBO.INV1 T0 INNER JOIN DBO.OITM T1 ON T0.ItemCode = T1.ItemCode
    WHERE Month(T0.DocDate) = Month(GetDate()) AND Year(T0.DocDate) = Year(GetDate())
    GROUP BY T0.ItemCode,T0.Dscription,T1.OnHand
    union
    SELECT T1.ItemCode, T1.itemname,T1.OnHand, '' AS 'Qty Sales',DAY(GetDate()) as 'Days',
    Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END AS 'Total days'
    ,'No Sales' AS 'TURN OVER IN MONTH'
    FROM DBO.OITM T1
    WHERE T1.ITEMCODE NOT IN (SELECT ISNULL(ITEMCODE,0) FROM INV1)
    GROUP BY T1.ItemCode,T1.itemname,T1.OnHand
    ORDER BY 1

  • Query for items on hold and items that are inactive for past 18 months.

    Hi Experts,
    We are on the process of initializing a new database due to database size, our client requested that we extract items from the current live database but only those items that are not On Hold and has been active for past 18 months. Those items that does not have transaction for the past 18months and currently on hold will be dropped. What will be the query to extract based on this filter? Please help. Thank you.
    Regards

    Hi,
    You may try this first:
    Select  t0.itemcode, t0.itemname, t0.onhand
    from dbo.oitm t0
    where t0.itemcode not in
    (select distinct itemcode from dbo.oinm  where DateDiff(DD,DocDate,GetDate()) < 548 group by itemcode)
    and t0.InvntItem = 'Y' and t0.Frozenfor = 'Y'
    Thanks,
    Gordon

  • Query item not sold per customer for this month compare with last month

    Dear all,
    i want to make query that show information about item sold per customer last month which is not sell again this month.
    for example last month customer A buy item 1,2 and 3. This month, customer A only buy item 2. So, the query will show information item 1 and 3 which is not sell again to customer A.
    Thanks a lot

    Here's one that will show you items bought in the last 60 days but not the last 30 days.  It's not perfect but will get you on your way, some bits will also not be relevant, like the qrygroup64 part.
    select     t0.cardcode,
              t0.cardname,
              t2.slpname,
              t1.itemcode,
              t1.itemname,
              t1.onhand,
              s0.[2mthqty],
              s0.[2mthdollar],
              s1.[1mthqty],
              s1.[1mthdollar],
              s2.lastsale
    from
    (select     t0.cardcode,
              t1.itemcode,
              sum(t1.quantity) as [2mthqty],
              sum(t1.linetotal) as [2mthdollar]
    from
    oinv t0
    inner join
    inv1 t1
    on t0.docentry = t1.docentry
    where t0.docdate >= getdate()-60
    and t1.quantity > 0
    group by     t0.cardcode,
                   t1.itemcode) s0
    full outer join
    (select     t0.cardcode,
              t1.itemcode,
              sum(t1.quantity) as [1mthqty],
              sum(t1.linetotal) as [1mthdollar]
    from
    oinv t0
    inner join
    inv1 t1
    on t0.docentry = t1.docentry
    where t0.docdate >= getdate()-30
    group by     t0.cardcode,
                   t1.itemcode) s1
    on s0.cardcode = s1.cardcode and s0.itemcode = s1.itemcode
    inner join
    (select     t0.cardcode,
              t1.itemcode,
              max(t0.docdate) as lastsale
    from
    oinv t0
    inner join
    inv1 t1
    on t0.docentry = t1.docentry
    where t0.docdate >= getdate()-60
    group by     t0.cardcode,
                   t1.itemcode) s2
    on s0.cardcode = s2.cardcode and s0.itemcode = s2.itemcode
    inner join
    ocrd t0
    on s0.cardcode = t0.cardcode
    inner join
    oitm t1
    on s0.itemcode = t1.itemcode
    inner join
    oslp t2
    on t0.slpcode = t2.slpcode
    where           (s1.[1mthqty] = 0 or s1.[1mthqty] is null)
    and t0.qrygroup64 = 'N'

  • Pension issue Mid Month Leaving

    Dear All,
    As per rule sustem should deduct mid month joining/leaving/absences or transfer scenarios, the Pension/PF Basis will be correspondingly prorated. But our system is not doing this. In RT table i have found 3FC Pension Basis for Er c 01/2010                    0.00           6,500.00.
    Employee leaving date is 14.04.2010. system is picking pension amout as 541. Last year it was coming right.
    Please suggest.
    Ashwani

    Dear Jayanti,
    We required prorata basis pension in case of left employees and system is not doing this. This is the issue. As per our PF experts Pension amount should come on prorata basis for left employees in case they left mid of month.System is doing prorata basis last year but from this year it is deducting 541. I am giving two RT cases of different years.
    RT table for year 2010. DOL 26.04.2010
    /111 EPF Basis              01/2010                    0.00           8,750.00 
    /139 VPF Basis              01/2010                    0.00           8,750.00 
    /3F1 Ee PF contribution     01/2010                    0.00           1,050.00 
    /3F3 Er PF contribution     01/2010                    0.00             509.00 
    /3F5 Ee Mon PF contribution 01/2010                    0.00           1,050.00 
    /3F6 Ee Ann PF contribution 01/2010                    0.00          12,600.00 
    /3F9 PF adm chrgs * 1,00,00 01/2010                    0.00              96.25 
    /3FA PF basis for Ee contri 01/2010                    0.00           8,750.00 
    /3FB PF Basis for Er Contri 01/2010                    0.00           8,750.00 
    /3FJ VPF basis for Ee contr 01/2010                    0.00           8,750.00 
    /3FL PF Basis for Er Contri 01/2010                    0.00           6,500.00 
    /3F4 Er Pension contributio 01/2010                    0.00             541.00
    /3FC Pension Basis for Er c 01/2010                    0.00           6,500.00
    /3FB PF Basis for Er Contri 01/2010                    0.00           8,750.00
    /3FC Pension Basis for Er c 01/2010                    0.00           6,500.00
    /3FJ VPF basis for Ee contr 01/2010                    0.00           8,750.00
    /3FL PF Basis for Er Contri 01/2010                    0.00           6,500.00
    /3R3 Metro HRA Basis Amount 01/2010                    0.00           8,750.00
    1BAS Basic Salary           01/2010                    0.00           8,750.00
    RT table for year 2009. DOL 27.10.2009
                                                                                    /111 EPF Basis              07/2009                    0.00           9,016.13
    /139 VPF Basis              07/2009                    0.00           9,016.13
    /3F1 Ee PF contribution     07/2009                    0.00           1,082.00
    /3F3 Er PF contribution     07/2009                    0.00             628.00
    /3F5 Ee Mon PF contribution 07/2009                    0.00           1,082.00
    /3F6 Ee Ann PF contribution 07/2009                    0.00           8,822.00
    /3F9 PF adm chrgs * 1,00,00 07/2009                    0.00              99.18
    /3FA PF basis for Ee contri 07/2009                    0.00           9,016.00
    /3FB PF Basis for Er Contri 07/2009                    0.00           9,016.00
    /3FJ VPF basis for Ee contr 07/2009                    0.00           9,016.00
    /3FL PF Basis for Er Contri 07/2009                    0.00           5,452.00
    /3FB PF Basis for Er Contri 07/2009                    0.00           9,016.00 
    /3FC Pension Basis for Er c 07/2009                    0.00           5,452.00 
    /3FJ VPF basis for Ee contr 07/2009                    0.00           9,016.00 
    /3FL PF Basis for Er Contri 07/2009                    0.00           5,452.00 
    /3R4 Non-metro HRA Basis Am 07/2009                    0.00           9,016.13 
    1BAS Basic Salary           07/2009                    0.00           9,016.13 
    Now please suggest what to do. where is the problem  ? If have also checked EXIT_HINCALC0_002 but nothing written in it.
    With Regards
    Ashwani

  • Is there a way to open two months at the same time in iCal?

    I have recurring events for every month in 2009 and want to replicate them in 2010. I do not want to just extend the stop date because there will be subtle changes to the 2010 items that I do not want changed in the 2009 versions. I would ideally like to open Jan 2009 and Jan 2010 next to each other and copy the 2009 event to the 2010 calendar (the appointment copy does not copy the recurrence info which is good). Is there a way to show either two instances of iCal running or 2 month windows?
    Thanks!

    Hi,
    If you activate iCal's Debug menu, you should find it has a 'New Calendar Window' option (Cmd-L). It is a bit of a knack to cutting and pasting correctly between windows.
    Best wishes
    John M

  • SSRS Expression Month at a glance

    I have a report that I am trying to regress the payment sums out month by month. I know how to do this in SQL, but no idea in SSRS. Below is what I would like the table to look like.
    Year                             Month                 
    Total Payments       Month1            Month2             Month 3
    2012                              1                      
    10,000.00                2000.00          2000.00            6000.00
                                         2                      
    15,000.00                5000.00           1000.00           9000.00
    And this would go on. I have the report built to drill down by year and month and show the sum of the payments. What I can not figure out is how to break out the payments collected month by month. I hope this makes sense.

    Okay after much playing with this I have starting having success. This is what I want to do.
    =sum(IIF(Fields!MPaidDate.Value = Month(Dateadd(DateInterval.Month, 1, Fields!Date_Recieved.Value))
    and Fields!YPaidDate.Value = Year(Fields!Date_Recieved.Value), Fields!Amount_Paid.Value,0))
    My month 1 column I left out the dateadd and I got back the right values. But when I try to add 1 month with date add it returns false.
    Why do you need to write conditional expressions like this?Isnt it enough to bring MONTH(datecolumn) as a field in your dataset and use matrix control in your report? Add year to rowgroup and Month to column group to get data split up into monthwise. And inside
    data part add three columns to show your measure value ie.#of orders ,
        Balance 
     &  Total Paid  
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Mini Month View in iCal

    Can't say I like the new iCal running on Lion. One feature that I can't seem to find is the mini month view. I did away with my paper calendar for viewing full months because of the mini month calendars on my Macs.
    Is that functionality gone? I've searched preferences and menus and can't find a way to turn it on.
    So many things about this new iCal that I find I do not like. I sure hope updates are coming to fix it.
    CJ

    Last thing about iCal which I think could be fixed, is that it would be easier to type down events and making line-breaks if one whouldn't have to hold 'Alt' in while doing it.  I make line-breaks much more often than I finish editing an event (in which case you just press enter or click outside the event you were editing).  It would be better to press 'alt' + 'enter' in order to finish editing an event, and reserve the action of just pressing 'enter' for line-breaks.  This, btw, was also this way in iCal 4.
    Ok, last last thing: in the preferences of iCal one can add a default alert to all new timed events and invitations and one can specify how many minutes before one wants to be alerted.  I do not want to add a default alert to all new events/appointments, but I would like to be able to specify the default number of minutes put on all new alerts that I put on events.  It seems quite intuitive to me that the default number of minutes one can specify for every alarm added to events by defult (if that option is checked in the preferences), should be the defult number of minutes set to alarms one manually puts on events, in stead of the '15 minutes before' default that is in the system and which seems to be unchangable.
    If it says '0 minutes before the start time' there, then all alerts that I manually put on events should have this value put to zero by default! 

  • Can I show a color bar instead of a color bullet in iCal Monthly view for all my events in all calendars?

    In the Monthly view of iCal the only events that show a color bar in the event is the Birthday Calendar. All other events in all my other calendars only show a color bullet next to the event (unless I click on that event which then shows as a color bar). I would like to know if it is possible for all the calendar events to have a color bar in the monthly view instead of just that tiny color bullet.

    Greetings Judith,
    Before making any attempts at deleting calendar data, backup what you have just in case:
    Click on each calendar on the left hand side of iCal one at a time highlighting it's name and then going to File Export > Export and saving the resulting calendar file to a logical location for safekeeping.
    iCal has an automated function located in iCal > Preferences > Advanced > Delete events "X" days after they have passed.  By typing in a value for days you can tell iCal to delete all events before that time frame.
    Example:
    Today is 4-16-2012.
    If I wanted to delete all events prior to 1 year ago (4-16-2011) I would type in "365" for the number of days.
    Once you type in the number of days you want kept in iCal, close the preferences and then quit iCal.
    Re-open iCal and check to see if the events are gone.  If not you may want to leave it open for several minutes and then quit again.
    Once the events are removed go back to  iCal > Preferences > Advanced > Delete events "X" days after they have passed and make sure the check mark is removed to prevent future deletion.
    Hope that helps.

  • How to print monthly view in ical

    I have the most current version of ical.  It wont let us print a monthly view.  It only lets us select fro day or list.  I am sure i am doing someething wrong, but I dont know what.  Running MAC OS X 10.5.8. 
    Ical version 3.0.8. 

    earlnkids,
    The text size selection should be available in the first page of the iCal print options:

Maybe you are looking for

  • Multiline to Polyline

    Hello All, I have quite a few geometries in one of my tables which are of the type multiline (gtype 2006) All of them need to be polylines (Gtype 2002) with only one start point and one end point. The geometries are not complex at all and I believe t

  • Can't seem to get rid of Spinning Beach Ball in Mail

    As someone else put it... it seems that Yosemite is Apple's VISTA.  Mail is fast becoming my most annoying App because clicking on almost any email seems to send the signal for the Spinning Beach Ball to appear.  Looking at activity monitor, it says

  • Cannot burn a disk in iPhoto

    I have not had this problem before, but recently I have not been able to back up my photos by burning a disk within iPhoto. I think the problem started after I installed Snow Leopard. Is there something I neglected to do after the installation? I can

  • Preview window stops working when skimming

    I have a top end MacBook Air (i7 / 4Gb) and find iMovie 11 works very well on it. However, recently I've been having problems with the preview window. I can be editing for some time when the preview window will just display the last frame that I play

  • IPad Network

    I deleted my home network on my iPad the other day as it wasn't finding it. I set it up again with the same network name and it now works fine, but didn't know which security to use. I was given the following choices; None, WEP, WPA, WPA2, WPA Enterp