Balance query

Hi,
i am using the below query to get the balance for a particular date.
select a1.stmt_date,i1.field_8,m1.field_9,(sum(a1.qty_receipt)-sum(a1.qty_delivery))
from t1 i1,t2 m1,t3 a1
where
i1.acc_no=m1.acc_no and
i1.acc_no=a1.acc_no and
i1.acc_no=100006850
group by a1.stmt_date,i1.field_8,m1.field_9
order by 1,2,3
output is
STMT_DATE     FIELD_8     field_9     (SUM(A1.QTY_RECEIPT)-SUM(A1.QTY_DELIVERY))
4/15/08 12:00 AM     4111986     340857     100000
4/15/08 12:00 AM     4431455     340857     8325000
4/16/08 12:00 AM     4111986     340857     100000
4/16/08 12:00 AM     4431455     340857     13325000
but my problem is i want balance based on field_8 not based on stmt_date field.
also i need that to be displayed in select statement.
can any one help me regarding this.

SQL> with samp_table as (
  2  select '4/15/08 12:00 AM' a, '4111986' b, '340857' c, '100000' d from dual
  3  union all
  4  select '4/16/08 12:00 AM' A, '4111986'  B, '340857' C, '100000' D from dual union all
  5  select '4/15/08 12:00 AM' a, '4431455' b, '340857' c, '8325000' d from dual union all
  7    8  select '4/16/08 12:00 AM' A, '4431455' B, '340857' C, '13325000' D from dual
  9  )
10  select distinct t1.a, t1.b, t1.c, t2.sumcol from samp_table t1,  (select b, sum(d) sumcol from samp_table group by b) t2
where t1.b=t2.b
order by 4;
A                B       C          SUMCOL
4/15/08 12:00 AM 4111986 340857     200000
4/16/08 12:00 AM 4111986 340857     200000
4/15/08 12:00 AM 4431455 340857   21650000
4/16/08 12:00 AM 4431455 340857   21650000

Similar Messages

  • GL Account Balance Query Issue

    Hi,
      I'm trying to extract GL Balances in the following format
    Company Segment(Segment2)  ||   Account Number(Segment1) ||  Cost Center Segment4 ||  Account Descr ||  Actual Flag || Account Type || Activity || Activity in Period || Currency || Period End date || Account Balance
    Here's my query :
    SELECT     gcc.segment4  "Company Segment",
               gcc.segment1  "Account",
               gcc.segment2  "Cost Center",
               a1.description "Account Description",
             --  a2.description Company_Description,
               Decode(gcc.account_type,'A','Asset','E','Expense','L','Liability','O','Equity','R','Revenue') "Account Type",
               Decode(gcc.enabled_flag,'Y','TRUE','FALSE')  "Active Account",
               Decode(abs(bal.Period_net_dr - bal.Period_net_cr),0,'FALSE','TRUE') "Activity in Period",
               bal.actual_flag  " Actual Flag",
               bal.currency_code  "Account Currency",
               per.end_date  "Period End Date",
               SUM(( NVL(bal.PERIOD_NET_DR,0) + NVL(bal.BEGIN_BALANCE_DR,0))) - SUM(NVL(bal.PERIOD_NET_CR,0)+NVL(bal.BEGIN_BALANCE_CR,0)) -
                         SUM( NVL(bal.BEGIN_BALANCE_DR,0) - NVL(bal.BEGIN_BALANCE_CR,0))   "Account Balance"
    FROM        apps.fnd_flex_values_vl a1,      --- For Account Segment
                apps.fnd_flex_values_vl a2,              -- For Cost Center
                apps.gl_code_combinations gcc,
                apps.gl_balances bal,
                apps.gl_periods per
    WHERE       a1.flex_value = gcc.segment1 
    AND         a2.flex_value = gcc.segment2
    and         a1.flex_value_set_id = 111111        -- Value set id for Account
    ---and         a2.flex_value_set_id = 222222    -- Value set id for Cost Center
    and         gcc.code_combination_id = bal.code_combination_id
    and          bal.period_name = per.period_name
    and         gcc.segment1 in ('777777')      --- Sample Account for testing only
    --and         gcc.segment2 in (222222)
    and         per.period_set_name ='GL_CALENDAR'
    and         bal.period_name ='SEP-13'
    and         bal.actual_flag='A'
    group by    gcc.segment4,
                gcc.segment1,
                gcc.segment2,
                a1.description,
               --            Decode(gcc.account_type,'A','Asset','E','Expense','L','Liability','O','Equity','R','Revenue'),
                Decode(gcc.enabled_flag,'Y','TRUE','FALSE'),
                Decode(abs(bal.Period_net_dr - bal.Period_net_cr),0,'FALSE','TRUE'),
                bal.actual_flag,
                bal.currency_code,
                per.end_date
                order by gcc.segment1,gcc.segment2
    1) If I  comment value set id 222222(Cost Center), then I'm getting 15 Records ,If I uncomment that I'm getting 10 records?Is there anything wrong with my queryAs I'm not displaying descriptions for cost center and company do I need to join fnd_flex_values_vl again or not ? 2) To check activity in particular period in this case for SEP-13,I'm using the following clause : Decode(abs(bal.Period_net_dr - bal.Period_net_cr),0,'FALSE','TRUE') Do I need to check ABS values also ro not?

    Hi,
      You can do this with WD dynamic programming.
      You can do with domodifyview badi for accounting component /SAPSRM/WDC_UI_DO_ACC.
      You need to handle both views 'V_DO_ACCOUNTING' and  'V_DO_ACCOUNT_DETAIL' in the domodifyview badi implementation.
    I am sending the sample  code. How to attach the custom search help dynamically.
      DATA lo_nd_comp_context    TYPE REF TO if_wd_context_node.
      DATA lo_nd_acc_context     TYPE REF TO if_wd_context_node.
      DATA lo_nd_info_acc        TYPE REF TO if_wd_context_node_info.
      DATA lv_value_help_mode    TYPE i.
      DATA lv_value_help         TYPE string.
      " Read Context
      lo_nd_comp_context = wd_context->get_child_node( name = 'COMP_CONTEXT' ).
      " get node info object of accounting node
      IF lo_nd_acc_context IS BOUND.
        lo_nd_info_acc = lo_nd_acc_context->get_node_info( ).
      ENDIF.
      " continue only if node info is supplied
      IF lo_nd_info_acc IS BOUND.
        " get current search help info
        lo_nd_info_acc->get_attribute_value_help(
          EXPORTING
            name            = 'G_L_ACCT'
          IMPORTING
            value_help_mode = lv_value_help_mode
            value_help      = lv_value_help
    " Below this will add the custom search help from SRM .
             lo_nd_info_acc->set_attribute_value_help(
            EXPORTING
              name            = 'G_L_ACCT'
              value_help_mode = 'BUS2121'
              value_help      = 'Z_F4-Your search help'   " you own search help.
      endif.
    Regards,
    Devi prasad

  • AP Subledger Trial Balance query in R12

    I have to display below columns in the output(AP Subledger Trial Balance) in R12:
    GL_CODE_COMBINATIONS(Segment1,segment3,segment4)
    GL_PERIODS(END_DATE)
    XLA_TRIAL_BALANCES(remaining amount)
    I have written a sql query but i need to satisfy below conditions in the below query. I am facing issues with the joins.can any one please help me to solve issue.
      ‘Accounting Period’ parameter needs to be added in the below query.
    The sql query will generate the AP subledger balance data for the particular operating unit from where the report is run.
    The report will give ‘at point in time’ data for the entire period for which the extract is run.
    Example:
    When the report is run on 01-Jul-2014 for the period ‘JUL-14′, then the report will extract all the data for JUL-14 at that point in time , i.e. the sysdate would be considered
    SELECT gcc.segment1,
    gcc.segment3,
    gcc.segment4,
    tb1.diff remaining_amount,
    glp.end_date –join condition required
    FROM gl_code_combinations gcc,
    gl_periods glp,
    (SELECT tb.code_combination_id,tb.ledger_id,
    SUM (NVL (tb.acctd_rounded_cr, 0)),
    SUM (NVL (tb.acctd_rounded_dr, 0)),
    SUM (NVL (tb.acctd_rounded_cr, 0))
    – SUM (NVL (tb.acctd_rounded_dr, 0)) diff,
    tb.gl_date
    FROM xla_trial_balances tb
    WHERE tb.definition_code IN(‘XX_US’,’XX_CA’)
    AND TRUNC(tb.gl_date) <= TRUNC(SYSDATE) –TO_DATE ('1-JUN-2014')
    GROUP BY tb.code_combination_id,
    tb.gl_date,tb.ledger_id
    HAVING SUM (NVL (tb.acctd_rounded_cr, 0))
    SUM (NVL (tb.acctd_rounded_dr, 0))) tb1
    WHERE tb1.code_combination_id = gcc.code_combination_id
    –Join condition required for gl_periods table to display end_date column.
    –org_id and period_name parameters are required

    Hi Vamsi,
    I've recreated the standard oracle Trial balance package & XML file . Now i'm able to populate the data into custom table as well as standard table . But the report out doesn't show data in it . it just shows report title, columns bUT NO DATA. the xml file itself doesnt contain data. The custom report completes in 2 mins. But standard report completes in 7 mins
    Steps
    1. Create custom package similar to oracle standard package & added new insert statement to populate trial balance data into custom table.
    2. created new datadefinition with new datatemplate(refering custom package) similar to oracle standard datatemplate.
    3. create template same as standard template.
    4. copy of standard conc program with custom application
    5. Ran the report ...able to populate data into custom table .....but unable to see data in the report.
    Please let me know if i'm missing anythng.

  • AP Trial Balance Query.

    I'm trying to re-create the AP Trial Balance report so I can add additional info for the Accountants allowing them to analyze the data better.
    we are in R12.1.3
    Can any anyone provide query that gives the same data as 'Accounts Payable Trial Balance'.
    Please in urgent need....
    Gurus help me out...
    Thanks,
    Raj.

    Hi,
    Were u able to create customized version of AP trial balance report. Please provide somepointers if so.
    Thanks
    TR

  • Debit & Credit Balance Query

    Hi Every One Im New Here..
    Firstly I Say .. If Im Post In Wrong Section Then Plz Move My Post. Its My First Post.
    Here Is My Question..
    I Have Two Tables.
    Please Tell Me How To Get Running Balance.
    Im Also Read Other Related Topic But Im Failed To Understand Plz Solve My Problem.
    Table Details Is Here !
    Table 1 : Users
    UID,Name,Description
    Table 2 : Balance
    BID,UID,Date,Dr,Cr,Description

    * I must say that you really do not invest on the question and gives us do all the work for you. This is bad! For example:
    >> You show us images, and tell us stories, what can we do with those? can we query an image? Instead of images you should post INSERT query with some sample data, as I did!
    I already wrote it in my forsy response! It was OK for first time, not for the continues discussion!
    ** In the next time please
    post queries to create the tables, and to insert some sample data, instead of "stories". It is faster and much more clear for us to see and if need reproduce the tables in our server in order to post a solution. This is example of
    what you should have post:
    >> You post "result that you want to get" without any result! what can we guess from this arrow?!?
    Why not to post the real result that you want to get, according to the sample data (which you did not post and we can only see in the image)?!?
    This is free supporting forum and you ask us too mu7ch in my opinion, while doing to little to help us to help you.
    If this is not what you need, then please start over and (1) post the create table query (2) post insert data queries that we will have the same data as the image (3) post the result that you want to get and not just a arrow.
    I think that this is what you need, please check if this help you:
    -- Current Balance
    select [UID],[Cr],[Dr], SUM(ISNULL([Cr],0)+ISNULL([Dr]*(-1),0)) OVER (partition by [UID] order by BID) as Current_Balance
    from Balance
    I hope this is helpful :-)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • SQL statement running balance query with previous balance taken into account

    Hi Guys
    I have a SQL statement which caclulates the running balance
    for a list of transactions in a transactions table. This SQL
    statement is as follows:
    SELECT transID, debit, credit,
    (SELECT SUM(debit-credit)
    FROM transactions as D1
    WHERE D1.transID <= D0.transID) AS balance
    FROM transactions AS D0
    The only problem I'm having is that I have to display
    transactions between a particular date range. I have for eg.
    transID, transDate, debit, credit fields in my db.
    However the problem I'm having is that when the transaction
    records are pulled out for the specified date range the balances
    are only calculated for those records. I need someway of having a
    balance b/f (brought forward) so that the selected records use that
    as a 'starting' balance and then calculate the running balance as
    normal.
    Any easy solutions?
    Many, many thanks for your help in advance.
    All the best
    Wesley

    You'd need to determine the b/f then apply it against the
    transaction records when they are pulled for a date range. So if
    the date range is
    Feb 1st, 2009 -> Feb 28th, 2009
    You'd need to also get the previous balance in a separate
    query, then use it to correctly display the running balance when
    you output the date range.
    I suppose a simpler way involving a little more DB work (and
    possibly lots of coding) is to store the current balance as well
    with each transaction; then when performing a date range you'd have
    the balance as well and not have to calculate it on the fly.

  • Amount to Reconcile in Debtors Outstanding  balance query

    Hi Experts.
    Below is the query i used to run Debtors Outstanding Balance. and its working fine but we need Amount To Reconcile Debit and Amount To Reconcile Credit Fields also..
    so pls modify this query and help me...
    SELECT T0.[TransId],T0.[RefDate], T0.[TransType] AS 'Origin Doc.Type', T1.[BaseRef] AS 'Origin Doc.No', T1.[ShortName], T2.[CardName],
    T1.[Account], T1.[ContraAct], T1.[CreatedBy], T1.[Debit], T1.[Credit], T1.[BalDueDeb], T1.[BalDueCred], T1.[LineMemo]
    FROM dbo.OJDT T0 
    INNER JOIN dbo.JDT1 T1 ON T0.TransId = T1.TransId
    INNER JOIN dbo.OCRD T2 on T2.CardCode = T1.[ShortName]
    WHERE T1.[MthDate] IS NULL AND T2.[CardName] LIKE '[%0]%'
    Regards,
    Vamsi

    Do you mean this:
    SELECT T0.[TransId],T0.[RefDate], T0.[TransType] AS 'Origin Doc.Type', T1.[BaseRef] AS 'Origin Doc.No', T1.[ShortName], T2.[CardName],
    T1.[Account], T1.[ContraAct], T1.[CreatedBy], T1.[Debit], T1.[Credit], T1.[BalDueDeb], T1.[BalDueCred], T1.[LineMemo], (T1.[Debit] - T1.[BalDueDeb]) AS 'Amount To Reconcile Debit', (T1.[Credit]-T1.[BalDueCred]) AS 'Amount To Reconcile Credit'
    FROM dbo.OJDT T0 
    INNER JOIN dbo.JDT1 T1 ON T0.TransId = T1.TransId
    INNER JOIN dbo.OCRD T2 on T2.CardCode = T1.[ShortName]
    WHERE T1.[MthDate] IS NULL AND T2.[CardName] LIKE '[%0]%'
    Thanks,
    Gordon

  • Financial Analytics: GL Balance query

    Hello,
    Does anyone if the project to date DR/CR balances as represented in the GL_BALANCES table in Oracle GL is represented in Financial Analytics 7.9.6.3.
    Specifically, I want to know where we have the situation where GL is enabled for basic project accounting, would the project_to_date_cr/dr information load into the data warehouse, do any of the standard reports allow you to query this information, or do we need to license Project Analytics for this information or build a customisation?
    Cheers,
    John

    Hi John,
    The GL_BALANCES fact table in Financial Analytics (W_GL_BALANCES_F) and it's related aggregates do not contain project_to_date_cr/dr measures; the simplest thing would be to add them by extending the ETL.
    Project Analytics does provide seeded measures for project costs and revenue to date, but these will not be in double entry format as per GL, and you would obviously need to be confident that Projects and the projects segment in the GL reconcile perfectly.
    Please mark if helpful/correct,
    Andy.

  • Need Balance Query

    create table users ([uid] INT PRIMARY KEY IDENTITY(1,1), name nvarchar(100))
    create table balance(bid INT IDENTITY(1,1) PRIMARY KEY, [uid] INT, dr FLOAT, cr FLOAT, FOREIGN KEY ([uid]) REFERENCES users([uid]))
    GO
    insert users ([Name]) values ('Haider'),('Ali')
    GO
    insert balance ([uid],[cr],[dr]) values (1,1000,null),(1,null,3000),(1,1000,null),(2,2000,null),(2,1000,null),(2,null,500)
    GO
    select * from users
    select * from balance
    GO
    I Want Output Like This...
    UID Name BID Dr Cr Balance
    1 Haider 1 Null 1000 -1000
    1 Haider 2 3000 Null 2000
    1 Haider 3 Null 1000 1000
    2 Ali 4 Null 2000 -2000
    2 Ali 5 Null 1000 -3000
    2 Ali 6 500 Null -2500
    First Order By uid then bid.
    If Possible Then Also Explain Your Query (Logic of The Query)
    Advance Thanks

    Thank you for trying to post DDL. Unfortunately, you do not know enough about SQL, RDBMS or basic data modeling to do it right.
    Consider this non-table:
    CREATE TABLE Users
    (uid INTEGER PRIMARY KEY IDENTITY(1,1),
    name NVARCHAR(100));
    INSERT Users (name) VALUES ('Haider'),('Ali');
    The ANSI/ISO syntax for insert is two word; insert by itself is old Sybase dialect. This is one of the code smells serious SQL programmers look for when they are fixing code. Would you trust an engineer who says “Centigrade” instead of “Celsius” in his work?
    IDENTITY is the count of psychical insertion attempts to one table on one disk on one computer. It cannot be a key by definition since it is never an attribute of an entity. And in addition to this, it is a numeric; identifiers are not numeric! What math do you do with a part number or the VIN on an automobile?
    There is no generic “name” in RDBMS; it has to be “<something in particular>_name according to ISO-11179 rules and common sense. And you really have used with a hundred Chinese character names? Or iwth a NULL name?
    Likewise, the other table is full of problems. Identity and INTEGER for identifiers again is the same error. But using FLOAT for money is illegal. Read the EU and GAAP rules for money! Why did you split each transaction into a debit or credit? We did that when we did not have negative numbers and wrote ledgers in Roman numerals. “Balance” is a computation and not an entity; it is not a table name. But you did understand that you need DRI! Most noobs do not.
    CREATE TABLE Users
    (user_id CHAR(16) NOT NULL PRIMARY KEY,
    user_name VARCHAR(35) NOT NULL);
    I used the length of a credit card number and the length of the user name. You did no research and used absurd attribute properties. Knowing industry standards is a fundamental database programmer skill you will need.
    Now ask what are you modeling in the table. Transactions! How are they ordered for reporting balances? By date! NOT BY THE DISK INSERTION ORDER ON ONE COMPUTER!!
    CREATE TABLE Transactions
    (user_id CHAR(16) NOT NULL
    REFERENCES Users(user_id),
    transaction date DATE DEFAULT CURRENT_TIMESTAMP NOT NULL
    PRIMARY KEY (user_id, transaction date),
    transaction_amt DECIMAL (12,5) NOT NULL
    CHECK (transaction_amt <> 0.00000)
    the query you really want is:
    SELECT user_id, transaction date,
    SUM(transaction_amt)
    OVER (PARTITION BY user_id
    ORDER BY transaction date
    ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
    AS user_balance
    FROM Transactions;
    >> If Possible Then Also Explain Your Query (Logic of The Query) <<
    I think I did that in painful detail
    :) most of the work (80-95%) in SQL is in DDL. Clean, careful DDL
    lets you write very simple, fast DML. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • BEx Load Balancing Query

    Hi,
    We are at Bi 7.00/AIX/Oracle.
    How can we load balance the query running via BEx. Most of the time it is going to CI, which is message server and not part of logon group. Our Web Queries are running fine because we have put a Logon Group in SICF for a required service.
    How can I resolve the BEx issue.
    Please let me know if it is possible.
    Thank you.
    Sume

    If you log on to BEx Analyzer and connect to a system you select an entry from the SAP Logon pad just as if you connect to a system with SAP GUI. In the system entry in the SAP Logon pad you can specify a logon group. This logon group is then also used in BEx Analyzer. Probably your system points to the CI without logon group.
    Regards, Klaus

  • Regarding BP Balance Query.

    Hello Experts,
    I need query for BP Balance
    BP Group Name,  BP Code,  BP Name,  Sales Employee Name,  BP Balance1 (01-04-2009 To 31-03-2010),
    BP Balance2 (01-04-2010 To 31-03-2011),  BP Balance3 (01-04-2011 To 31-03-2012)
    Thanx in advance.
    Help for this query.
    Regards
    Pratik

    Hi
    try this
    DECLARE @ENDDATE
    DATETIME SET @ENDDATE = (SELECT MAX(T2.DOCDATE) FROM [DBO].[INV1] T2 WHERE T2.DOCDATE <= '[%0]')
    SELECT T0.[CardCode]
    ,  T0.[CardName]
    , t4.groupname
    , T3.SLPNAME
    , DBO.F_Ypoloipo_Hmer_basilis(T0.cardcode,@ENDDATE)
    FROM OCRD T0
    INNER JOIN OCTG T1 ON T0.GroupNum = T1.GroupNum
    INNER JOIN OINV T2 ON T0.CARDCODE=T2.CARDCODE
    INNER JOIN OSLP T3 ON T0.SLPCODE=T3.SLPCODE
    inner join ocrg t4 on t4.groupcode=t0.groupcode
    WHERE T2.Docdate <= @ENDDATE
    scalar valued function
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    ALTER FUNCTION [dbo].[F_Ypoloipo_Hmer_basilis]
    (@cardcode AS NVARCHAR(10),
    @ENDDATE AS DATETIME
    RETURNS
    NUMERIC(19,2)
    AS
    BEGIN
    DECLARE
    @RESULT1 AS NUMERIC(19,2),
    @RESULT2 AS NUMERIC(19,2),
    @RESULT AS NUMERIC(19,2)
    SELECT @RESULT1=SUM(T0.debit)
    FROM jdt1 T0
    --WHERE T0.SHORTNAME=@CARDCODE AND (T0.dueDATE <= @ENDDATE)
    WHERE T0.SHORTNAME=@CARDCODE AND (T0.refDATE <= @ENDDATE)
    SELECT @RESULT2=SUM(T0.credit)
    FROM jdt1 T0
    --WHERE T0.SHORTNAME=@CARDCODE AND (T0.dueDATE <= @ENDDATE)
    WHERE T0.SHORTNAME=@CARDCODE AND (T0.refDATE <= @ENDDATE)
    SELECT @RESULT=ISNULL(@RESULT1,0)-ISNULL(@RESULT2,0)
    RETURN @RESULT
    END

  • AP and AR balance query

    Hi Hussein, or some one else can please help, the requirement is that i need to give a report of the total money that is going out ie. payable to suppliers as AP payables and total money that is expected to come in from Customers-AR open balances on a particualar date. Can any one help.
    Regards
    Santy

    Hi Santy,
    What you really need here is a Cash Forecasting report. This report needs to include the inflows from Receivables and outflows from Payables.
    You may refer the following metalink note
    Cash Forecasting: How to set it up and run a forecast.
    Doc ID: 130626.1
    Hope this helps.
    Thanks,
    Anil

  • White Balance Query

    Whilst on holiday, I must have accidentally changed thw white balance on my camera to Tungsten, as when I came back, I had the Tungsten WB logo showing on my camera LCD panel.
    I have managed to catch most of the images, but I am concerned I may have done this another time. Is there a way in Lightroom (1.4.1) to extract only those images with a Tungsten WB setting?
    Ta
    Colin

    Are these black on white line art? Try using Levels or curves.

  • Azure Load Balancer - Query for VMs in rotation or removed from rotationq

    From what I can tell, there is no way to know if any of the VMs configured as part of a Load-Balanced Set has been taken out of rotation. I see a PS script to set the Azure Load Balancer Endpoint -
    Set-AzureLoadBalancedEndpoint.  But there is no way from what I can tell via
    PS or in the Portal to notify or alert me when a VM is no longer part of the LB Set due to some issue. What is the roadmap to make this available via a PS Script, Azure Portal, or via SCOM?  

    Hi,
    From my experience, this issue was more related with Windows Azure network, I suggest you move to that forum for a better help.
    The forum link was:
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=WAVirtualMachinesVirtualNetwork
    Best Regards
    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.

  • BP Balance query?

    Hi experts,
    I need a query that will help me design a report for a customer.
    The query should show the journal entry transactions for business partners, that is their debit and credit transactions.
    Also the query should help me to design the report and group by the business partners and secondly group by the account name as well.
    This query should help me to be able to choose a business partner and the report will show all the business partner's transactions and show all it's
    Debit and credit per the account name.
    NB: the query I want to see the bp name,the bp code,the account name,the account code, the transition id,debit,credit,remarks,ref1,ref2,ref3.
    Please assist me experts.
    Urgent help is needed.
    Regards,
    Justice

    Hi,
    Try this query:
    SELECT T3.[CardCode], T3.[CardName], T0.[Debit], T0.[Credit], T0.[Account], T2.[FormatCode], T0.[TransId], T0.[Debit], T0.[Credit], T1.[Memo], T0.[Ref1], T0.[Ref2] FROM JDT1 T0  INNER JOIN OJDT T1 ON T0.TransId = T1.TransId INNER JOIN OACT T2 ON T0.Account = T2.AcctCode INNER JOIN OCRD T3 ON  T0.[ShortName]  = t3.cardcode WHERE T0.[ShortName] = [%0]
    Thanks & Regards,
    Nagarajan

Maybe you are looking for