Sales Report query by Sales Employee

Hi All
I need your help I have a problem with a custom report I created based on a query.
Here is the query.
SELECT T4.[SlpName], T3.[ItmsGrpNam], sum(T0.[LineTotal]) AS 'Line Total' FROM [dbo].[INV1]  T0 INNER JOIN [dbo].[OINV]  T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T0.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod INNER JOIN OSLP T4 ON T0.SlpCode = T4.SlpCode WHERE T1.[DocDate] >=[%0] AND  T1.[DocDate] <=[%1] GROUP BY T4.[SlpName], T3.[ItmsGrpNam] ORDER BY T4.[SlpName], T3.[ItmsGrpNam]
This report is must show the same info. as the sales analysis report based on sales employee and gropued by item group.
Hope this is clear thanks
Bongani

create crystal report using query
SELECT  T1.DocDate, T4.SlpName, T3.ItmsGrpNam, sum(T0.LineTotal) AS 'Line Total' FROM dbo.INV1 T0 INNER JOIN dbo.OINV T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T0.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod INNER JOIN OSLP T4 ON T0.SlpCode = T4.SlpCode  GROUP BY T4.SlpName, T3.ItmsGrpNam ORDER BY T4.SlpName, T3.ItmsGrpNam
and pass doc date as parameter in crystal report.
you cant pass parameters directly in query to use in crystal report.
you you want to pass parameter s in query create the stored procedue in sql.
other wise pass the parameters in crystal report.
hope this will help you
regards,
neetu

Similar Messages

  • Sales Report for US Sales and Use tax

    Hi,
    I'm looking for t-code to extract detailed sales report having Gross sales, Exempt sales , Ship to state, Ship to County\ City,  Sales Tax collected. If I'm getting this report i can verify what my sales tax software is updating.
    When i extract  tcode - ZINVLIS i don't get much detail.
    Please help me in extracting complete sales detail which can be used for sales and use tax verification process and audit purpose.
    Thanks,
    Karthik

    Hi Karthik,
    There is no standard report available as per my knowledge.You may develop Z report to achive your requirment. Check some LIS report can give data (MC01 is transaction where you can check all type of key figure reports)
    Regards
    Mani Kumar

  • Sales report query - some help?

    Hi,
    I'm trying to create a report that goes all trough the sales documents by line showing the status.
    The problem is that the JOIN is multiplying the rows of the documents.
    Maybe someone did something similar in the past?
    SELECT distinct T0.[U_ProjectCoTi] , T0.[U_ProjectName], T0.[CardCode], T0.[CardName],
    T0.[DocNum] as 'SO Num.', (T0.DocTotal - T0.VatSum) as 'SO Net Amount',
    T0.[DocDate] as 'SO Date',
    Case when (T1.[LineStatus] = 'O') then 'Open'
         when (T1.[LineStatus]= 'C' and T1.[Trgetentry] = ' ') then 'Cancelled'
         when (T1.[LineStatus] = 'C' and T1.[Trgetentry] != ' ') then 'Closed'
    End as 'SO Line Status',
    T3.[DocNum] as 'Del. Num.', T2.Linetotal as 'Del. Row Amount',
    T3.[DocDate] as 'Del Date',
    Case when (T2.[LineStatus] = 'O') then 'Open'
         when (T2.[LineStatus]= 'C' and T2.[Trgetentry] = ' ') then 'Cancelled'
         when (T2.[LineStatus] = 'C' and T2.[Trgetentry] != ' ') then 'Closed'
    End as 'Del. Line Status',
    T5.[docnum] as 'Inv. Num.', 
    T4.Linetotal as 'Inv. Row Amount', T5.[DocDate] as 'Inv Date',
    Case when (T4.[LineStatus] = 'O' and T5.DocStatus = 'O') then 'Open'
         when (T4.[LineStatus]= 'O' and T5.DocStatus = 'C') then 'Closed'
         when (T4.[LineStatus] = 'C' and T5.DocStatus = 'C') then 'Closed'
    End as 'AR Inv. Line Status'
    FROM ORDR T0 Left join rdr1 t1 on t0.docentry = t1.docentry
         Left JOIN DLN1 T2 on t1.trgetentry = t2.docentry
         Left join odln t3 on t2.docentry = t3.docentry
         left join inv1 t4 on t2.trgetentry = t4.docentry
         left join oinv t5 on t5.docentry = t4.docentry

    Hi Cynthia,
    I am not 100% sure that I get what you are trying to do, but could it not be an idea to use Union in the query and create separate queries for each document instead of joining Orders, Deliveries and Invoices.
    Something like:
    Select 'Sales Order', docnum, docstatus from ordr
    union
    Select 'Delivery', docnum, docstatus from odln
    union
    Select 'AR Invoice', docnum docstatus from oinv
    Obviously this is just a suggestion on the structure, then in each query you need to do the join with the lines etc etc.
    Hope it helps,
    Jesper

  • Modifying Detailed Sales Report Query

    Hello All --
    Can we adjust the Query below so that the current Company, Address, City, State and Zip have the letters BT in front (for Bill To)?
    Then, can we add new columns of the Company, Address, City, State and Zip for the Ship To with ST in the front of the names?
    Thanks!!
    Mike

    Mike,
    It seems BT and the State are in two seperate lines on the Query.  Please check the following
    SELECT 'Invoice' "Invoice/AR CM", T0.CardCode
    "BP Code", T0.CardName 'Company', T0.Address 'BT Address', T2.City 'BT City', T2.State1 'BT State', T2.ZipCode 'BT Zip', T0.Address2 'ST Address', T3.Name, T0.DocDate,T0.DocNum, T0.DocTotal 'Gross Amt', T0.TotalExpns 'Freight/Svc Charge',
    (T0.DocTotal - T0.VatSum-T0.TotalExpns) 'Net Order', T1.SlpName 'Sales Rep', T1.Commission '% Commision',
    ((T0.DocTotal - T0.VatSum-T0.TotalExpns)*(T1.Commission/100)) 'Commission Amount', T4.GroupName 'Group'
    FROM dbo.OINV T0 LEFT JOIN dbo.OSLP T1 ON T0.SlpCode = T1.SlpCode
    LEFT JOIN dbo.OCRD T2 ON T0.CardCode = T2.CardCode
    LEFT JOIN dbo.OCPR T3 ON T0.CntctCode = T3.CntctCode
    LEFT JOIN dbo.OCRG T4 ON T4.GroupCode = T2.GroupCode
    WHERE (T1.SlpName BETWEEN '[%0]' and '[%1]') AND
    (T0.DocDate BETWEEN '[%2]' AND '[%3]')
    UNION ALL
    SELECT 'Credit Memo' "Credit", T0.CardCode, T0.CardName,
    T0.Address, T2.City, T2.State1, T2.ZipCode, T0.Address2,
    T3.Name, T0.DocDate,T0.DocNum,
    -T0.DocTotal, -T0.TotalExpns,
    -(T0.DocTotal - T0.VatSum-T0.TotalExpns),
    T1.SlpName,
    T1.Commission,
    ((T0.DocTotal - T0.VatSum-T0.TotalExpns)*(-T1.Commission/100)),
    T4.GroupName 'Group'
    FROM dbo.ORIN T0 LEFT JOIN dbo.OSLP T1 ON T0.SlpCode = T1.SlpCode
    LEFT JOIN dbo.OCRD T2 ON T0.CardCode = T2.CardCode
    LEFT JOIN dbo.OCPR T3 ON T0.CntctCode = T3.CntctCode
    LEFT JOIN dbo.OCRG T4 ON T4.GroupCode = T2.GroupCode
    WHERE (T1.SlpName BETWEEN '[%0]' and '[%1]') AND
    (T0.DocDate BETWEEN '[%2]' AND '[%3]')

  • How to club the following COGS / Sale report, and add sale order value also to this report

    ------------------------------COGS-----------------------------------------------------
    SELECT X.Cardname, SUM(X.Jan) JAN, SUM(X.FEB) FRB, SUM(X.MAR) MAR, SUM(X.APR) APR, SUM(X.MAY) MAY 
                  , SUM(X.JUN) JUN, SUM(X.JUL) JUL, SUM(X.AUG) AUG, SUM(X.SEP) SEP, SUM(X.OCT) OCT 
                  , SUM(X.NOV) NOV, SUM(X.DEC) DEC, SUM(X.GT) GT  
        FROM ( 
        SELECT T0.Cardname 
                  , CASE DATEPART(m,T0.DocDate) WHEN 1 THEN T0.CogsVal ELSE 0 END JAN 
                  , CASE DATEPART(m,T0.DocDate) WHEN 2 THEN T0.CogsVal ELSE 0 END FEB 
                  , CASE DATEPART(m,T0.DocDate) WHEN 3 THEN T0.CogsVal ELSE 0 END MAR 
                  , CASE DATEPART(m,T0.DocDate) WHEN 4 THEN T0.CogsVal ELSE 0 END APR 
                  , CASE DATEPART(m,T0.DocDate) WHEN 5 THEN T0.CogsVal ELSE 0 END MAY 
                  , CASE DATEPART(m,T0.DocDate) WHEN 6 THEN T0.CogsVal ELSE 0 END JUN 
                  , CASE DATEPART(m,T0.DocDate) WHEN 7 THEN T0.CogsVal ELSE 0 END JUL 
                  , CASE DATEPART(m,T0.DocDate) WHEN 8 THEN T0.CogsVal ELSE 0 END AUG 
                  , CASE DATEPART(m,T0.DocDate) WHEN 9 THEN T0.CogsVal ELSE 0 END SEP 
                  , CASE DATEPART(m,T0.DocDate) WHEN 10 THEN T0.CogsVal ELSE 0 END OCT 
                  , CASE DATEPART(m,T0.DocDate) WHEN 11 THEN T0.CogsVal ELSE 0 END NOV 
                  , CASE DATEPART(m,T0.DocDate) WHEN 12 THEN T0.CogsVal ELSE 0 END DEC 
                  , T0.CogsVal GT 
        FROM dbo.OINM T0 
        WHERE T0.DocDate BETWEEN [%0] AND [%1]) X 
        Group By X.Cardname
    ---------------------------------------Sale ----------------------------------------
    SELECT X.CardName, SUM(X.Jan) JAN, SUM(X.FEB) FRB, SUM(X.MAR) MAR, SUM(X.APR) APR, SUM(X.MAY) MAY 
                  , SUM(X.JUN) JUN, SUM(X.JUL) JUL, SUM(X.AUG) AUG, SUM(X.SEP) SEP, SUM(X.OCT) OCT 
                  , SUM(X.NOV) NOV, SUM(X.DEC) DEC, SUM(X.GT) GT  
        FROM ( 
        SELECT T0.CardName 
                  , CASE DATEPART(m,T0.DocDate) WHEN 1 THEN T0.DocTotal ELSE 0 END JAN 
                  , CASE DATEPART(m,T0.DocDate) WHEN 2 THEN T0.DocTotal ELSE 0 END FEB 
                  , CASE DATEPART(m,T0.DocDate) WHEN 3 THEN T0.DocTotal ELSE 0 END MAR 
                  , CASE DATEPART(m,T0.DocDate) WHEN 4 THEN T0.DocTotal ELSE 0 END APR 
                  , CASE DATEPART(m,T0.DocDate) WHEN 5 THEN T0.DocTotal ELSE 0 END MAY 
                  , CASE DATEPART(m,T0.DocDate) WHEN 6 THEN T0.DocTotal ELSE 0 END JUN 
                  , CASE DATEPART(m,T0.DocDate) WHEN 7 THEN T0.DocTotal ELSE 0 END JUL 
                  , CASE DATEPART(m,T0.DocDate) WHEN 8 THEN T0.DocTotal ELSE 0 END AUG 
                  , CASE DATEPART(m,T0.DocDate) WHEN 9 THEN T0.DocTotal ELSE 0 END SEP 
                  , CASE DATEPART(m,T0.DocDate) WHEN 10 THEN T0.DocTotal ELSE 0 END OCT 
                  , CASE DATEPART(m,T0.DocDate) WHEN 11 THEN T0.DocTotal ELSE 0 END NOV 
                  , CASE DATEPART(m,T0.DocDate) WHEN 12 THEN T0.DocTotal ELSE 0 END DEC 
                  , T0.DocTotal GT 
        FROM dbo.OINV T0 
        WHERE T0.DocDate BETWEEN [%0] AND [%1]) X 
        Group By X.CardName

    Hi,
    Use Mr. Gordon's query and concept to create above report for only for Jan month.
    If you need for particular year and for all months, use below query:
    SELECT X.CardName, SUM(X.JanCOG) 'Jan-Cogs', SUM(X.JanINV)  'Jan-Inv',SUM(X.FebCOG) 'Feb-Cogs', SUM(X.FebINV)  'Feb-Inv',SUM(X.MarCOG) 'Mar-Cogs', SUM(X.MarINV)  'Mar-Inv', SUM(X.AprCOG) 'Apr-Cogs', SUM(X.AprINV)  'Apr-Inv', SUM(X.MayCOG) 'May-Cogs', SUM(X.MayINV)  'May-Inv',SUM(X.JunCOG) 'June-Cogs', SUM(X.JunINV)  'June-Inv',SUM(X.JulCOG) 'July-Cogs', SUM(X.JulINV)  'July-Inv',SUM(X.AugCOG) 'Aug-Cogs', SUM(X.AugINV)  'Aug-Inv',SUM(X.SepCOG) 'Set-Cogs', SUM(X.SepINV)  'Sep-Inv',SUM(X.OctCOG) 'Oct-Cogs', SUM(X.OctINV)  'Oct-Inv',SUM(X.NovCOG) 'Nov-Cogs', SUM(X.NovINV)  'VNov-Inv',SUM(X.DecCOG) 'Dec-Cogs', SUM(X.DecINV)  'Dec-Inv'
    FROM
    (SELECT CardName, [1] JanCOG, 0 JanINV,[2] FebCOG, 0 FEBINV,[3] MarCOG, 0 MARINV,[4] AprCOG, 0 AprINV,[5] MayCOG, 0 MayINV,[6] JunCOG, 0 JunINV,[7] JulCOG, 0 JulINV,[8] AugCOG, 0 AugINV,[9] SepCOG, 0 SepINV,[10] OctCOG, 0 OctINV,[11] NovCOG, 0 NovINV,[12] DecCOG,0 DecINV
    FROM (SELECT T0.[CardName], T0.CogsVal,
    MONTH(T0.DocDate) Month FROM OINM T0 where year(t0.docdate) = 2014
    ) S
    PIVOT(SUM(CogsVal) for Month in ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])) P
    UNION ALL
    SELECT CardName, 0,[1] JanINV, 0,[2] FebINV, 0,[3] MarINV, 0,[4] AprINV, 0,[5] MayINV, 0,[6] JunINV, 0,[7] JulINV, 0,[8] AugINV, 0,[9] SepINV, 0,[10] OctINV, 0,[11] NovINV, 0,[12] DecINV
    FROM (SELECT T0.[CardName], T0.DocTotal,
    MONTH(T0.DocDate) Month FROM OINV T0 where year(t0.docdate) = 2014
    ) S
    PIVOT(SUM(DocTotal) FOR Month in ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])) P) X
    GROUP BY X.CardName
    Thanks & Regards,
    Nagarajan

  • SIS: Sales Report as per sales office and material

    Hi All,
    Is there any standard report with selection fields as sales office, Material and Month for invoice sales.
    Thanks

    Hi,
    Check with MCTG
    Regards!
    Sadanand

  • MATERIAL GROUPS SALES REPORT

    Dear ALL
    Is there any sales  report that shows sales by Material Groups.
    Thank your very much in advance for your help.
    Best Regards
    Edited by: Fanalist on Aug 16, 2010 9:20 AM

    Hi,
    I hope there is no such standard report.However you can use SD-SIS to drill data basis product hirearchy for reporting purpose.
    If business requirement is material group wise you can simply get a report developed through ABAPer from VBRK and VBRP table.
    Regards
    Sanjay

  • Customer sales report by customer category

    Hi to all,
    as we have maintained a price lists customer wise and the attached the customer according to its category.so when i apply a price change to a specific category it ill automatically applicable to all the customer under this category.
    now my question is that can i have a sales report as per the customer category instead of puttting individual customer codes to execute the report?
    thanks
    Attiq

    Dear JP the error is "no condition record exist for this selection"
    but if i am not wrong this is a pricing report not the sales report,i need sales report.
    thanks.

  • Sales employee wise sales report

    Hi,
    Can anyone explain me,how to write functional specifications to obtain sales employee wise sales report?
    Thanks in advance..
    Regards..
    Yogi...

    Hi
    This is the standard T Code for sales employee-MCTI
    But as per your requirement we hv to create.
    Examplemy past implimantation..we hv captured sales employee as partner function.sales employee1& 2  with peoper  partner determination proceture.then we hv captured at Billing document Header Partner function.
    This Sales employee name has to captured through HR Master data.According U hv to say only the business process and from where data has to captured to ABAPER.
    I think it ll help
    Regards
    JAGA

  • Sales report issue while saving the query

    Hi,
    I am working on Sales reports and that i came across a senario and facing a problem, can anyone help me over this
    Senario:
    I created a structure in Rows and added few keyfigures to the New structure which is in Rows.
    After that i added 2 charcteristics.
    Now the problem is that when i save the query i am getting the Keyfigure structure first and then characteristics
    But, i need the 2 charcteristics first and then i need the Keyfigures
    I changed the query as i want it like i placed 2 charcteristics first and then the keyfigure (structure) and the query saved sucessfully.
    The problem is that when i open the query again i found that the Keyfigure (structure) first and then the 2 charcteristics
    I did it all my possible ways still the problem perstists
    Edited by: MAHESH MUMAR on Oct 6, 2008 2:22 PM
    Edited by: MAHESH MUMAR on Oct 6, 2008 2:32 PM

    mahesh,,,
    can u xplain more what xactly is ur need.
    "After that i added 2 charcteristics."
    so do u want chars & keyfig in Rows only.
    this way i dont think u will have report output ..
    Take simple e.g. below:
    $----
    Quantity
    Material
    Channel112--
    1
    Channel223--
    34
    Is this how u want ur report to display?
    that means u will need material and channel in rows and keyfigures ($ & quantity ) in Columns.
    if this is not what u seek what else is your rek.
    sometimes such display helps to understand.
    Yes u can add chars in Rows and then add structure of keyfigure.
    Yes you can change the sequence of display in Rows among different structure.
    But do u still have something in columns.
    It is intersection of Rows & Columns that displays result data set...
    let us know in more detailed e.g.

  • Query for Weekly Sales Report

    Dear Experts,
    I have developed the query for weekly sales report for the alert management to send out the report on every Monday as follow :
    SELECT T0.[CardCode], T0.[CardName], T0.[DocDate], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[LineTotal] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode WHERE T0.[DocDate] between GetDate()-8 and GetDate()-1
    The weekly report received on every Monday through email is without column total for the "Line Total".
    Can the Sum of column "Line Total" to be included in the query ?
    Thus, the auto send report on every Monday by alert management will display the total.
    Thanks in advance for all your kind assistance.
    Regards,
    Clara

    Ok you want it at the bottom.......
    then you must must try this if you are running query generator....
    Else a good option is Crystal Report.
    You need to only add Group Sum.......
    SELECT T0.CardCode, T0.CardName, T0.DocDate, T1.ItemCode, T1.Dscription, T1.Quantity, T1.LineTotal FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode WHERE T0.DocDate between GetDate()-8 and GetDate()-1
    Union All
    Select '','',Null, '','Total',Null, Sum(T1.LineTotal) FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode WHERE T0.DocDate between GetDate()-8 and GetDate()-1
    Regards,
    Rahul

  • Ability log and track the time and expense reports of the sales employees

    Hello Experts
    Ability to log and track the time and expense reports of the sales employees.
    Can we do this through WEB UI
    Please revert.
    Regards

    Hello
    Thanks for the reply
    I thought of storing time zone in the time and use session variable to pick up user's log in info along with time zone that he is associated with.
    However, if it has to be maintained by a table, then it should be manually updated right? I don't think that's what I want to do because a lot of our users travel a lot for short time, so they may not have their time zone info updated in the DB table when they are traveling somewhere else for a brief period while accessing OBIEE.
    So my question is, how can I pick up user's locale time zone setting and make sure that the data, such as hour conversation are converted along with the displayed time stamp?
    Thanks

  • Calculation of Quaterly Figures for Sales Report.

    Hi,
    I would like to display the Sales report in the Quarterly format with respect to  sales employees.
    For Ex :-
    1)Q1-20 Lacs  (April,May June 07)
    2)Q2-30 Lacs   (July Aug ,Sept 07)
    3)Q3-25 Lacs   (Oct,Nov and Dec 07)
    4)Q4-20 Lacs   (Jan.Feb,Mar 08)-Also i would like to view the current month say Jan 08 i.e till date sales.
    It should display Monthly sales and Quartely sales with the Quartely totals.
    Please advise me as to how to proceed with the Formaulae,Restriction in BEX Query.
    Let me knw if u require any further info.
    Thank in Advance
    wth rgds
    SVU
    Edited by: svu123 on Jan 8, 2008 3:47 PM

    Hi Kenneth
    1) you can use statistical FC means with input data your histoy and you outputr your proportional factor if you want e.g. to have an average of the last 13 or 24 months, with use of moving average simply, if you want to have a constant value
    2) you can use a calculated KF that copies from history to proportional factor by shifting by one year, using PERIODID shift. THere are example in the SAP model for a year-1 lag calculation
    3) You can do as in 2, but in addition make use of any additional formula according to your needs
    4) you can NOT have a dynamic calculation, because prerequisite for disaggregation is that you keyfigure used in the fisaggregation
    - is stored and not calculated
    - has the same base planning level than the KF itself
    Yours
    Irmi

  • Sales Report Generation less the Credit memo

    Anybody can help me regarding Query for Sales Report. Im trying to create a sales report per Per Product and Customer with corresponding Quantity and Amount, I have already get the query the problem is I cant get the Credit Memo deduct from its A./P Invoice so that deduct the quantity and price. With this i can get the exact sales!
    Anybody have an idea? Im having headache already for a week now trying to solve this problem, Thank you very much.
    Clint

    Hi Jeyakanthan,
    Im not referring to Sales Analysis Report. All i want is to get all the sales and Less the the corresponding Credit Memo. Im trying to create a query that will show the sales, Ex.. row
    From A/R invoice Table
    DocNo CardCode   Qty   Price  DocTotal  
    0111     CA-001     10     25      250
    less from A/R Credit Memo
    DocNo CarCode    Qty   Price  DocTotal  
    0111     CA-001     5      25      125
    I want the result to deduct the row Invoice from CM.
    If the corrsponding Invoice doesnt find a CM record then the result will be 0. Ex from above data Invoice less the Credit Memo.
    if the Invoice found a Credit Memo,
    Qty1       Qty2    Qty3, DocTotal1 DocTotal2 = Result
    10   less  5      =  5 ;    250   less 125         =   125
    if the Invoice doesnt have Credit Memo,
    Qty1       Qty2    Qty3, DocTotal1 DocTotal2 = Result
    10   less  0      =  10 ;    250   less 0            =   250
    hope the will clarify everything, thank yuo very much in advance.
    Regards,
    Clint

  • Query for Sales Order Analysis

    Dear Experts
    I have written a Query for Sales Order Analysis and would like to have help on this.
    The query is used for generating daily report for Sales Order on number of documents (Sales Order), total amount of sales orders and total GP of Sales Order. The query is written as below:
    SELECT T0.[DocNum], SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
    FROM ORDR T0 WHERE T0.[DocDate] =[%0] GROUP BY T0.[DocNum] ORDER BY T0.[DocNum]
    where U_Total_GP is a UDF for storing the GP of each order.
    After executing the query, a selection criteria of date appears and after a date is selected, the report shown information required. However, the query does not calculate column total for total amount and total GP. Although I know the total for each column can be displayed by pressing "Ctrl" + Click on the column title, it would have to be done from time to time.
    Therefore, I would like to modify my query in order to calculate the column totals when executed. Are there any suggestions for this?
    Thank you
    Regards
    Elton

    Hi Elton,
    Try this:
    SELECT T0.[DocNum], SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
    FROM ORDR T0 WHERE T0.[DocDate] =[%0] GROUP BY T0.[DocNum]
    Union ALL
    SELECT '', SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
    FROM ORDR T0 WHERE T0.[DocDate] =[%0]
    ORDER BY T0.[DocNum]
    Thanks,
    Gordon

Maybe you are looking for

  • How i can save report updation on report builder 10g

    how i can save report updating on report builder 10g please help me any help will be appreciated

  • RoboHelp 9 HTML crashing

    This may get a bit lengthy but I want to lay it all on the table in the hope of getting to the root thus helping to arrive at an answer. For the past several months I've been developing a help system for a food processing plant. This is a brand new p

  • OS X Mavericks downloading for 2 days?

    It has barely moved and I have no idea why. How do I restart or correct this? Is anyone else having the same problem?

  • Using gcc (in Cygwin) for JNI - resource.h not found. drand48 not found

    Hello, I am trying to use gcc for JNI. I have successfully executed simple programs like Hello World and Message Box. Now I have a C project that I am trying to use in JNI (Its FOIL 6.4 by Quinlan). I have written the .java file and the .c (wrapper)

  • Cannot start EPMA FIle Generator

    I cannot get the EPMA file generator to run. I am running a Windows XP client system within a VM and have all other 11.1.2 clients running correctly. EPMA server is running and I can connect to it via Workspace. Whenever I start the EPMA File Generat