"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

Similar Messages

  • How to use ABAP include in SLT parameter

    Hi Frzz,
    Could some one guide me how to use ABAP include in SLT parameter to perform calculations.
    Best Regards,
    Krishna.

    Hi,
    We can have ABAP includes within SLT advanced replicaiton settings.
    Go to IUUC_REPL_CONTENT select the applicable schema configuration name.click on "Select Configuration" button.
    you could see all the tables that are in replication.
    select the required table and then click on "edit settings for selected tables".
    in the next screen select "IUUC_***_RUL_MAP" tab . here we hve the option to insert line of code or abap include as per the requriement.
    please refer the techincal manual of SLT as well for more detailed information on advanced replicaitons within SLT.
    Thank you.
    Shishupal

  • How to make query base delivery monthly report  link with delivery return

    Hi,
    I have facing some problem in Sales delivery report monthly. Problem is:
    1) When i make Monthly query delivery report without any delivery return and AR Credit memo, it is Fine.
    2) When i make Monthly query delivery report with any delivery return and AR Credit memo, it is not showing proper. Its showing in report including return quantity or AR Credit memo quantity.
    So, How to make query base delivery monthly report  link with delivery return and AR Credit Memo?
    Please help me regarding this.
    Mizan
    Edited by: mizan700 on Dec 18, 2010 2:50 PM
    Edited by: mizan700 on Dec 18, 2010 2:50 PM

    Hi,
    try this.
    SELECT DISTINCt T1.CARDCODE, T1.CARDNAME , T1.DOCNUM DELIVERY#,T1.DocStatus 'DELIVERY STATUS', T1.DOCDATE 'DELIVERY Date', T1.DocTotal 'DELIVERY Total', T3.DOCNUM Return#,T3.DocStatus 'Return Status', T3.DOCDATE 'Return Date', T3.DocTotal 'Return Total',T5.DOCNUM Invoice#,T5.DocStatus 'Invoice Status', T5.DOCDATE 'Invoice Date', (T5.DocTotal-T5.VatSum-T5.TotalExpns-T5.DiscSum) 'Total Before Discount', T5.VatSum 'Tax', T5.TotalExpns 'Freight', (T5.DocTotal - T5.PaidToDate) 'Total Payment Due', T7.DOCNUM AS 'CREDIT MEMO#', T7.DOCDATE
    FROM DBO.DLN1 T0
    INNER JOIN DBO.ODLN T1 ON T1.DOCENTRY = T0.DOCENTRY
    LEFT JOIN DBO.RDN1 T2 ON T2.BASEENTRY = T1.DOCENTRY
    LEFT JOIN DBO.ORDN T3 ON T2.DOCENTRY = T3.DOCENTRY
    LEFT JOIN DBO.INV1 T4 ON T4.BASEENTRY = T1.DOCENTRY
    LEFT JOIN DBO.OINV T5 ON T5.DOCENTRY = T4.DOCENTRY
    LEFT JOIN DBO.RIN1 T6 ON T6.BASEENTRY = T5.DOCENTRY
    LEFT JOIN DBO.ORIN T7 ON T7.DOCENTRY = T6.DOCENTRY
    WHERE  T1.DOCDATE >= [%0] AND  T1.DOCDATE <= [%1]
    Thanks,
    Joseph

  • Can anyone give me simple instructions on how to use more than one ipod on the same computer with itunes? Both my daughters have ipods, my wife has one

    Dear All
    Can anyone give me simple instructions on how to use more than one ipod on the same computer with itunes. My daughters have a different generation 'nano' each & my wife a 'shuffle'?
    Many thanks

    Click here for options.
    (69081)

  • How to use the Include Statement in the BADI

    Dear All,
            I am trying to implement the BADI. So i need to use the Include in the BADI.
    How to use the Include statement in the BADI. I cant able to use it in the Public, Private and protected statement.
    Where should i mention that,,,,
    Thanks
    Yogesh

    Hi Sharat,
      Thanks for your reply.
    I need to use the BADI HRWPC_PCR_APPR_FORM. In which the values are available in the Container. So if i need to use the container values then i need to use that include <cntain>.
    Is there any possible ways to make it.
    Thanks
    Yogesh

  • When i update apps on my iphone they need the ID that i used when i downloaded these app and i forgot this ID and a make a new ID how i used the new one to update these apps thanks

    Hello all,
    when i update apps on my iphone they need the ID that i used when i downloaded these apps and i forgot this ID and a make a new ID
    How i used the new one to update these apps?
    thanks

    Your device can hold apps from multiple IDs, but to update them you have to swicth identities which is time consuming. If possible use only the one ID. If you need to reset the password for your old ID visit My Apple ID.
    tt2

  • How to use query-database() function in transformation?

    Hi All,
    How to use query-database() function in transformation?
    It is giving four fields but if i write select query in sqlquery field it is saying select node is not found....
    plz help me out
    Regards
    Pavankumar
    Edited by: [email protected] on Jul 29, 2009 2:49 AM

    Hi,
    To answer your query:-
    http://abhishek-soablog.blogspot.com/2008/08/orclquery-database.html
    Cheers,
    Abhi...

  • How do I get a one-month subscription to the latest version of InDesign program

    How do I get a one-month subscription to the latest version of InDesign program

    As you can see here, single apps are $29.99/month with no annual commitment.

  • Exp Command how to use query in Exp (oracle9i)

    How to use query in Exp

    Read the Utilities Guide and see for yourself.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch01.htm#1005843

  • How can I buy only one month service of indesign cc from online shop?

    How can I buy only one month service of indesign cc from online shop? it seems only allow to buy one year package service. PLA HELP !

    http://www.adobe.com/products/catalog/software._sl_id-contentfilter_sl_catalog_sl_software _sl_allsoftware.html#
    Click on Join, then from plan select: Month to month

  • How do I pay for one month subscription to convert a ms word file to excel file?

    How do I pay for one month subscription to convert a ms word file to excel file?

    Hi,
    I need to know do you want to convert word PDF file into Excel file or something else?
    Please elaborate.
    Regards,
    Florence

  • How to use output of one query as an input for another

    Hi Gurus,
    can you give me any links on how to use an output of one query as an input for another (preferably if this can be done in a dynamic/on the fly way)?
    thanks

    You can use Replacement Path Variable for this purpose. See this detailed documentation.
    http://help.sap.com/saphelp_nw04s/helpdata/en/bd/589b3c494d8e15e10000000a114084/content.htm
    Abhijit
    Edited by: ABHIJIT TEMBHEKAR on Nov 19, 2008 9:48 AM

  • How to use more than one device under same apple ID?

    How do you you use more than one device under same apple ID? say for facetime?

    You don't. One Device and one Apple ID.

  • How to use more than one JCo in one project?

    hi all,
    I want to use more than one r/3 systems and want to switch between them while running the application.
    For that, how can I use more than one JCo connection in one project and how to activate/deactivate them so as to switch in between them? And if that possible then what am I suppose to do in order to fetch the data from activated R/3 while running the application.
    Regards,

    Hi,
    Try this threads
    Multiple Client Logon in JCO
    Multiple JCO client connections
    Regards
    Saravanan K

  • How to use more than one region 'Conditional Display'

    Hi,
    I use a region and i want to use 2 Conditional Display for this region:
    . Fisrt when 'Request Is Contained within Expression 1' ==> 'Val1,Val2'
    . Second when 'Inline Validation Errors Displayed'
    Is it possible.
    Thanks

    Hi,
    The first one is relatively straightforward as there is a Condition Type available for that.
    The second one is a bit more complicated but can still be done. Have a look at Re: how to use wwv_flow.g_inline_validation_error_cnt? This will tell you how many validations failed. If there were any failures, you can set a hidden page item to 1, for example, and then use this page item in your condition
    Andy

Maybe you are looking for

  • Storage device for mac AND pc

    Hi, last night I dropped my nano and the screen is fairly broken - lots of cracks and no picture at all (although the light comes on). Not really too bothered - it was only 1gb, got it free with my computer, and the click wheel was being tricksy, so

  • Hyperlink from Word to PDF

    Is it possible to make a link from a Word file to a specific page or part of a page in a PDF? I'm using Word 2003 and Acrobat Pro 7 on Windows XP SP2. If it makes a difference, I've got Acrobat Pro 9 here. Haven't installed it yet. Ken

  • No video on low resolution TV

    My Apple TV is connected to a TV that supports up to 480p (75Hz). It is set at the resolution: 640 by 480 at 60Hz. It still does not work. The TV says Not Support.

  • Groups and Authorization

    Hello, I'm looking for the best way to use groups as a means to authorize. I have set up groups such as 'Group A', 'Group B', and I tried to set up a PL/SQL authorization scheme as follows: wwv_flow_user_api.current_user_in_group('Group A') But the P

  • DW CS4 fails to load

    I loaded CS4 (Web Premium) last week.  DW opened successfully at that time. I tested site files.  Now I get an alert (at line 25 of file "...Configuration\Floaters\WA_Memento.js:document.reminders\WP.document.track" has no properties).  When I click