Query sales per month per customer

Hello,
I have a query for the months january and february working. Now I want to add more months.
When I do this, the query works, BUT I get very strnage amounts.
Instead of 20,000 I get an amount of 1.650.000
Can someone please tel me where I go wrong?
SELECT T0. [CardCode] ,
T0. [CardName] ,
(SUM (T1.Debit) - SUM (T1.Credit ) ) AS ' [November 2013] ' ,
(SUM (T2.Debit) - SUM (T2.Credit ) ) AS ' [December 2013] ' ,
(SUM (T3.Debit) - SUM (T3.Credit ) ) AS ' January ' ,
(SUM (T4.Debit) - SUM (T4.Credit ) ) AS ' February ' ,
(SUM (T5.Debit) - SUM (T5.Credit ) ) AS ' March ' ,
(SUM (T6.Debit) - SUM (T6.Credit ) ) AS ' April '
FROM dbo.OCRD T0
LEFT JOIN dbo.JDT1 T1 ON T1.ShortName = T0. CardCode AND Month (T1.DueDate ) = 1 AND Year (T1. DueDate ) = Year (GetDate ( ) ) AND T1. TransType in (13, 14)
LEFT JOIN dbo.JDT1 T2 ON T2.ShortName = T0. CardCode AND Month (T2.DueDate ) = 2 AND Year (T2. DueDate ) = Year (GetDate ( ) ) AND T2. TransType in (13, 14)
LEFT JOIN dbo.JDT1 T3 ON T3.ShortName = T0. CardCode AND Month (T3.DueDate ) = 3 AND Year (T3. DueDate ) = Year (GetDate ( ) ) AND T3. TransType in (13, 14)
LEFT JOIN dbo.JDT1 T4 ON T4.ShortName = T0. CardCode AND Month (T4.DueDate ) = 4 AND Year (T4. DueDate ) = Year (GetDate ( ) ) AND T4. TransType in (13, 14)
LEFT JOIN dbo.JDT1 T5 ON T5.ShortName = T0. CardCode AND Month (T5.DueDate ) = 5 AND Year (T5. DueDate ) = Year (GetDate ( ) ) AND T5. TransType in (13, 14)
LEFT JOIN dbo.JDT1 T6 ON T6.ShortName = T0. CardCode AND Month (T6.DueDate ) = 6 AND Year (T6. DueDate ) = Year (GetDate ( ) ) AND T6. TransType in (13, 14)
WHERE T0. CardType = 'C'
Group By T0. [CardCode] , T0. [CardName]

Hi,
Please check any manual journal entry posted for that month.
Thanks & Regards,
Nagarajan

Similar Messages

  • A query with workingdays per month per persons per period

    Can anyone help me on the way in building a difficult SQL query?
    I work with Oracle SQL. It is intended to calculate over a certain period, to find the working days for each month for each person.
    I have a working query for calculate the number of days for 1 months minus holidays
    Select count (*) NUM_WORK_DAYS
    From (
    Select to_date ('01-01-2010 ',' dd-mm-yyyy ') + ROWNUM-1 as day
    From all_objects
    Where ROWNUM <to_number (to_char (last_day ('01-01-2010 '), DD')) + 1)
    Where to_number (to_char (day, 'd')) between 1 and 5
    And not exists (select NULL
    From HOLIDAY
    Where Holiday.hol=day)
    There is a datetable with the following structure where I can get the periods:
    DATES
    YEAR | MONTH | WEEK | SD
    2010 | 201002 | 201006 | 09/02/2010
    All required months are present
    It is intended that the user give a beginning and a end time specify.
    I have a table of workingdays per person named
    CALENDAR
    CAL | MON | TUE | WED | THU | FRI | SAT | SUN
    Person | Y | Y | N | Y | Y | N | N
    And a table of holidays
    HOLIDAY
    CAL | HOL
    Person | 01/01/2010
    How can I combine the query for working days and build a query that returns for multiple people over multiple months the number of workingdays per month? I will ask the user to give a beginning period and a end period
    I am aware that I ask a lot of your time, but I can not imagine the solution myself. Many thanks in advance
    Gr,
    Els

    You can do something like this:
    SQL> select * from calendar;
        PERSON M T W T F S S
             1 Y Y N Y Y N N
             2 Y Y Y Y Y N N
    SQL> select * from holiday;
        PERSON HOL
             1 12-FEB-10
             2 09-FEB-10
    SQL> define start_day=2010-02-01
    SQL> define end_day=2010-02-20
    SQL> with period as (
      2  select DATE '&start_day' start_date, DATE '&end_day' end_date
      3    from dual),
      4  days as (
      5  select start_date+level-1 day
      6    from dual,period
      7  connect by level <= end_date-start_date+1),
      8  mycal as (
      9  select person, 'monday' day, mon works from calendar union all
    10  select person, 'tuesday' day, tue from calendar union all
    11  select person, 'wednesday' day, wed from calendar union all
    12  select person, 'thursday' day, thu from calendar union all
    13  select person, 'friday' day, fri from calendar union all
    14  select person, 'saturday' day, sat from calendar union all
    15  select person, 'sunday' day, sun from calendar
    16  )
    17  select person, count(0)
    18    from mycal c, days d
    19   where c.day = trim(to_char(d.day,'day'))
    20     and c.works='Y'
    21     and not exists (select 1 from holiday h where h.person=c.person and h.hol=d.day)
    22  group by person;
    old   2: select DATE '&start_day' start_date, DATE '&end_day' end_date
    new   2: select DATE '2010-02-01' start_date, DATE '2010-02-20' end_date
        PERSON   COUNT(0)
             1         11
             2         14The PERIOD view is there only to accept start and end date.
    The DAYS view contains all the days of the period
    The MYCAL view unpivotes the calendar days returning 7 rows for each person, a row per weekday
    Max
    http://oracleitalia.wordpress.com

  • Usage hour per month per user

    Hi,
    Is it possible to get SAP users & months wise usage hours details.
    eg.
    User id1        JAN        10.25 Hours
    User id 2       FEB        05.00 Hours
    Thanks in advance.
    Rahman

    You can see the user and transaction activity per months and hours (range) using ST03N:
    - Go to ST03n - Change the user mode to 'Expert mode'
    - Under 'Detailed Analysis' choose the instance, date and time you want to analyze.
    - Under 'Analysis Views' open 'User and Settlement Statistics' and double click in 'User Profile'. You will see then the list of users were using the instance in the period of time you selected before. IF you want to see more, double click each user and you will see the transactions executed and the time response for each one.
    Good luck,

  • HT201238 is Icloud charge per month per annum or one off fee table not clear

    Does anyone know whether the icloud charges are for the month or year or one off?

    Per year:

  • How do I total expenses per month

    I am using the check register template in numbers.  I added a table to calculate a running total of expenses per category per month.  I can get the table to keep a running total of expenses per category, but have not been able to add the per month value.  How do I add that part into my formula. Specifically, my formula so far is =SUMIF(Transactions :: $Category,A2,Transactions :: Amount).  Now all I need is to add the month value so I can see how much I am spending per month per category.

    Transactions
    Beginning Balance
    $126.37
    Type
    Date
    Description
    Category
    Amount
    Balance
    Debit
    3/19/12
    Gas at Shell
    Bills
    $          (50.54)
    $          75.83
    Debit Card
    3/20/12
    Starbucks
    Starbucks
    $          (1.79)
    $          74.04
    Debit Card
    3/21/12
    Freebirds Austin
    Food
    $          (9.72)
    $          64.32
    Debit Card
    3/23/12
    Smokey Mo’s
    Food
    $          (7.00)
    $          57.32
    Deposit
    3/26/12
    Deposit
    Deposit
    $          100.00
    $          1,444.57
    Debit Card
    Bills
    $          1,444.57
    DEP
    Bills
    $          1,444.57
    DEP
    Bills
    $          1,444.57
    Debit Card
    Bills
    $          1,444.57
    105
    Bills
    $          1,444.57
    DEP
    Bills
    $          1,444.57
    Debit Card
    Bills
    $          1,444.57
    Bills
    $          1,444.57
    Here is an example of the checking register table I am building
    Category
    Amount
    Home
    $          0.00
    Food
    $          (16.72)
    Bills
    $          (50.54)
    Credit Card
    $          0.00
    Entertainment
    $          0.00
    Starbucks
    $          (1.79)
    Total
    $          (69.05)
    And here is an example of the table for "March" that I am building. But, I only want March expenses to add in this table.  Once April comes around, I want a new table to show expenses per category for that month. 
    I am new to this community, to have patience please.

  • CAR - minutes per month reporting

    CUCM - 9.1(1)
    I can report on the total amount of calls per month per number in CAR using:
    CAR > System Reports > Traffic > Summary by phone number
    I'm also trying to report on the total number of minutes a phone is in calls over a monthly period too.  How would I do this?
    Many thanks
    Trevyn

    If there's no pre-configured report for that, you could export the CDR data from the CAR web page and then use Excel to sort by number and calculate the total number of minutes for a certain month.

  • Number of open sales notes/contracts per month

    Kindly inform are there any stanadard reports in SD for following:
    1. Number of open sales notes/contracts per month
    2. Discounts & Credit notes as % of sales
    3. Days sales outstanding report
    4. Number of bounced cheques trends and % of sales
    5. Customer information report
    6. customers segmatation categories report
    will be very thankful to you all.
    thanks
    anya

    for 1& 3 VA05 and XD03--->Sales Summary of Customer
    Regards
    Prabhu

  • Show sales per month

    Hi,
    Are trying to make a report showing the sales amount planned to be shipped out per month, having the salesprice for each Project in a textfield (text 24) trying to summarize all items that are have finishdate within the current month.
    Is this, or someting similar possible to do in Project? Have spent some hours now unable to find a solution.
    Kind regards //Anders

    Hi Anders,
    May I suggest a different approach to manage the data required for your report?
    I would create a new cost resource with the Accrue At = End
    Then you can build your project plan, assign your resources and finally build a custom report
    When you build the custom report, Time (can be changed to display months) can be use for the Field List (Resources) and, if you need,a filter for a limited number of resources can be applied
    Hope this helps
    Paul

  • Sales Per Month

    Hi..
    How do u find sales per month for a company?
    I have seen FS10N in GL Account display of the sales account but i am not able to comprehend as to what is the exact sales figure?
    Please help?
    Regards,
    Kiran

    Hi Kiran,
    check this may be it can help you.
    Tcode: <b>MCH:</b> - STRPS
    for more info <a href="http://help.sap.com/search/highlightContent.jsp">click here</a>
    Regards,
    Venu.
    Message was edited by:
            Venu Narayana

  • Create sales order in ref to quantity contract automatically once per month

    Hi there.
    Is it possible to create a sales order (ZOR) automatically, for example, once per month, in reference to a quantity contract (CQ) for as long as the contract is valid ?
    So, instead of create manually a subsequent order on the contract let it be done automatically. Once per month or once per week or once per .......
    Each contract needs to create it is own sales order. There are approx. 50contracts.
    Would appreciate your help on this.
    cheers !
    Ed

    We can write a BDC and schedule the program every month in the back ground.
    It needs ABAP and Basis help.
    Reward points
    Regards,
    Anbu

  • Dramatic Drop in Books Sales from Over 270 per month to less than 70. Any answers as to why? Has this happened to others?

    Sales of my books averaged over 270 per month for almost all of 2011 and 2012 and for January of 2013--then in February of 2013 and continuing to the present, sales dropped to less than 70 per month.
    The sudden drop from over 270 per month to less than 70 per month with sales suddenly falling off the fiscal cliff in Februrary of 2013 is inexplicable.  I can find no reason for it. 
    Therefore, I am asking other authors: Has this happened to you? Any idea of what changed? I presume something must have changed within the itunes bookstore, or there was a change in the listing of my books.

    In additon to this forum, we contacted Apple Ibookstore support and this afternoon they may have provided the explantion:
    According to Apple:
    "iBookstore that change frequently including top charts and any featured placement sections (IE: New and Noteworthy sand other special or seasonal sections). All featured placement is solely at the discretion of Apple and isn't guaranteed. If your book was in one of these prominent sections or top charts before and is no longer there, this might be what you are noticing in your numbers."
    Fortunately for us, our authors probably got us featured placement for 2 years. Unfortunately for us, after 2 years it appears we were shoved aside for another pretty face. Thus, book sales imploded.
    We thank Apple for answering our inquiries and providing us with useful information as to how to (hopefully) drive sales back up.

  • Workaround for 1 invoice per month

    Hi There,
    Is there anybodywho could suggest me how to implement if a customer wants 1 invoice per month??
    But the separate deliveries over the whole month. And auto create 1 invoice at the end of the month with the document generation wizard.
    thanks Mark

    Hi Mark,
    Go to Sales -A/R->Document Generation Wizard and set your target document and according all data.
    The document generation wizard lets you save the defined parameter set. First, you enter and save numerous parameters for base and target documents. Based on these definitions, you can select consolidation methods and choose a list of relevant business partners.
    Once you save the defined parameter set, you can run the wizard periodically according to your companyu2019s business practices.
    Thanks
    Sachin

  • Problem with bex query listing sales "this month" and "same month last year

    Hi,
    I've created a query in BW BEx, where I have a mandatory variable for 0calmonth, and I list 0material and sales (in volume, liter). And I have a restricted key figure giving me sales (volume in liter) restricted with 0calmonth = variable - 12, to give me the sale for the same month the user select, previous year.
    This seems to be working, the sum is correct, but when adding up the number for the sales in the month previous year, the numbers does not fit the sum in the end.
    I think the report only lists materials with sales the month selected in the variable, if a material has not been sold that month, but in the same month last year, it's not listed in the reports, but it's added in the sum in the end.
    Example.
    We have three records like this:
    material - calmonth - volume
    101 - 01.2010 - 5
    101 - 01.2011 - 8
    201 - 01.2010 - 7
    The report will give the following (calmonth variable = 01.2011)
    Material - volume this month - volume same month last year
    101 - 8 - 5
    Sum 8 - 12
    Any way to solve this issue? We noticed because we run BO - Webi on top of the BEx query, and BO sum's the values per material, and in webi the report would give us the sum 8 and 5.
    Any input is appreciated.
    Regards,
    Øystein

    Hi,
    thanks for your reply.
    The error is that the report only seems to list materials that has been sold "this month", and if the same material was sold the same month last year, it will also list the volume for this.
    But if the material is only sold in the same month last year, it's not listed in the report, but it's calculated into the sum at the end.
    The report is listing material, which is why the error presents itself, as you said
    Getting 8 minus 12 is correct unless you drill down by material. In that case, it should be 8 minus 5 and 0 minus 7.
    The row with 0 - 7 is not shown, and my guess is that the report will only list materials that has sales this month (which has been selected in the variable)
    Regards,
    Øystein
    Edited by: Oystein Gundersen on Mar 21, 2011 4:36 PM

  • How to go from 150$ per month to 750$ per month in BizSpark?

    Hey,
    I apologize if this is in a wrong forum category but I am new to this.
    As the title explains I just want to know what steps should I do to achieve 750$ per month. I asked some of my friends about it and they told me that it is by doing a multiple accounts or something like that, but I am still not aware of the exact process.
    Thanks in advance,
    ViRuSeS

    hi ViRuSeS,
    Thanks for your posting.
    It seems that every subscription has 150$ per month, they have 5 subscriptions. I recommend you refer to this blog:
    http://blogs.msdn.com/b/niallsblog/archive/2014/08/22/activating-your-5-free-azure-accounts-on-bizspark.aspx
    And you also contact to Azure support team for more details:
    http://www.windowsazure.com/en-us/support/contact/
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I pay 25 euros for three moit for illustrator but I can not use it. I try to cancel my subscription, but it's impossible because it is written that I have not paid subscription! Yet adobe takes me 25 euro per month!

    I pay 25 euros for three moit for illustrator but I can not use it. I try to cancel my subscription, but it's impossible because it is written that I have not paid subscription! Yet adobe takes me 25 euro per month!

    Delphine,
    I believe this is one for a chat,
    Creative Cloud support (all Creative Cloud customer service issues, chat open between 5AM and 7PM PST/PDT on workdays)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html
    or for Adobe phone Support,
    http://helpx.adobe.com/adobe-connect/adobe-connect-phone-numbers.html

Maybe you are looking for

  • Extremely slow and high latency all day.

    DSL is running extremely slow during peak hours from 12 afternoon to 12 midnight.   Lower than 50% of rated speed and high latency I have been frustrated with this DSL Service for months now.  I am considering contacting BBB to file a complaint and I

  • Splitting Application into separate projects

    I'd tried to split my domain layer (annotated EJB3) into separate project, from my service layer (EJB3 session beans) - that used to run together happily but I got the following error against each entity. Exception [TOPLINK-198] (Oracle TopLink - 10g

  • Storage problem: "Other" taking up all space

    To situate my context: I'm IT-specialist at my school, where we have an 1:1 iPaddeployment for about 700 pupils and 100 teachers. Most of the pupils use the 16gb wifi version, purchased near the end of August '12. Over the last month, we've have abou

  • How to print smartform on the basis of selection criteria

    i want to print multiple pages in smartform by using  select-options  bkpf-belnr. ex:1500002103 to 1500002106. print all the pages lie in between this range. Moderator message : Spec dumping is not allowed, search for available information. Thread lo

  • OCI gets ORA-01036, 8.1.6 on RH 6.2

    Newbie Alert! I'm very green at Oracle, trying to use OCI to talk to a remote 8i server. 8i client ONLY is installed on the RH box. My program allocates a series of handles (error, service, etc., etc.) does the ServerAttach, SessionBegin, StmtPrepare