Average Balances in GL-(Not a PL/SQL question - Related to Financials)

Hi All,
The question may be silly and awkward - I am completely ignorant in GL and tried a lot in Google..
Our requirement is to calculate the monthly average balances for each code combination id (GL_BALANCES) after the month end.
One way is to calculate the average balance from daily balances.
Just wanted to know if it is already getting stored in any table.
Thanks in advance,
jeneesh
Note: The question is already posted in Financial Services Forum.. ( Average Balances in General ledger. ). Sorry for duplicating.

Hi,
jeneesh wrote:
... Note: The question is already posted in Financial Services Forum.. ( Average Balances in General ledger. ). Sorry for duplicating.Since you know it's wrong to post the same question twice, and you know where the correct forum is, don't the question here. Close this thread right away.

Similar Messages

  • There is an unclosed comment block in the SQL statement. Ensure that there are balanced "/*" and "*/" comment markers in the SQL statement.

    I get this error - when I try a Multi-line comment entry - by using the /* and */
    "There is an unclosed comment block in the SQL statement. Ensure that there are balanced "/*" and "*/" comment
    markers in the SQL statement."
    Even though I am entering both the /* and the */.
    I tried it many way - in the same line, in different lines etc..
    like 
    /* Select xxx from xxx */
    or
    Select xxx from xxx
    or 
    /* Select xx from xx
    Please help anyone..! ;=(

    But When I do a Help/About I see that it is 
    the SSMSE's Help About screen says "SQL Server 2005"
    However I downloaded and installed SQL Server 2014 last night and was entering queries..
    Most Select Queries work fine..
    the -- comment line works fine..then I stumbled on the /*  - */ does not work.
    Thanks.
    Well, you have two different version of SQL Server installed on your machine. Please connect again from SSMS to the SQL Server 2014.
    T-SQL Articles
    T-SQL e-book by TechNet Wiki Community
    T-SQL blog

  • Average the value based on day in SQL

    I have a table with two fields (SampleTime, value) the table likes:
    SampleTime field2
    1999-01-01 01:00:00 0.01
    1999-01-01 02:00:00 0.01
    1999-01-01 03:00:00 0.03
    The sample time has one hour interval. How can get average value of field2 based on day? like:
    1999-01-01 average of all values within 1/1/99
    1999-01-02 average of all values within 1/2/99
    1999-01-03  average of all values within 1/3/99
    Is there a build-in function in SQL to implement this?  It should be very sample. But I am not sure how to write this SQL query statement. Thanks. 

    Can explain the parameters : varchar(8), sampletime, 10?
    What do these parameters mean?
    Thanks.
    you wanted the date in mm/dd/yy format... convert(varchar(8),sampletime,10) gets you the output in that format..
    you did not mention your sql version, if sql 2008 and above, you can use date funtion(it the format does not matter).
    declare @table table (SampleTime datetime,field2 decimal(3,2))
    insert into @table
    values
    ('1999-01-01 01:00:00','0.01'),
    ('1999-01-01 02:00:00','0.01'),
    ('1999-01-01 03:00:00','0.03')
    select avg(Field2),Convert(varchar(8),sampletime,10) from @table group by Convert(varchar(8),sampletime,10)
    --SQL 2008 and above
    select avg(Field2),Cast(sampletime as date) from @table group by Cast(sampletime as date)
    Hope it Helps!!

  • Average Balance Key Figure

    Hi,
    I have typical problem in FIAR Query. For the given Customer (say 1000170) having several Customer Classes like A, B, C etc.. and I need to find out AVERAGE BALANCE for Each Customer.
    Eg: Customer 1000170
    Customer Class: A = 100
    B = 120
    Average Balance: I need to get 110 But I am getting Summing value like 220)
    Solution: Right click the Average Balance KF and chage to "Average" mode. I am getting the average value for all the customers in the Query, but not for the given customer.
    Please advice me

    Im not sure i understand correctly but when calculating average you need to multiply line-item wise and then divide by the total. So you can make a new key fig called axb and do the multiplication in the transfer rules and divide to get the average in the query itself.
    I hope I have answewed your question.

  • How to calculate Average balance for an account

    Hi,
    How to calculate average balance for an account for a particular period say for JAN-12 period and after the end of that period for another two days 01-feb-12 and 01-feb-12 ?
    I'm using the following query :
    SELECT cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6 "Account_XX",
    nvl(sum(l.accounted_dr - l.accounted_cr),0) "Balance"
    FROM gl_code_combinations cc,
    gl_je_lines l
    WHERE cc.code_combination_id = l.code_combination_id
    AND l.set_of_books_id ='XX'
    and code_combination_id = replace it with code combination_id for account_xx
    AND l.effective_date <= '31-Jan-12' (january period end ??)
    GROUP BY cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6
    There are some discrepancies in "average balance" after end of month (Jan-12)?
    How to calculate average balances for a particular account (Account_XX above)from end of month of Jan to first two days of february?
    Thanks,
    Kiran

    Kiran,
    Please let me know first, is Average Balancing feature enabled in your GL Ledger?
    Regards
    Muhammad Ayaz

  • Shrink database is not active in SQL SERVER Enterpriser manager

    Dear guru
    Shrink database is not active in SQL SERVER Enterpriser manager what to do
    Rupesh
    SAP BASIS Consultant

    Hi,
    >Thank you very much for not supporting i have solved the problem by reading some other documents
    That's exactly what I wanted you to do : With a little personal work, you can actually learn to do your own work ! "Don't give fish to hungry people. Teach them how to go fishing !"
    Regards,
    Olivier

  • SQL Browser not started in SQL Express 2012

    I just installed SQL Express 2012 on a Windows Server 2008. I downloaded the advanced 64bit installation file and selected all the options except SSRS. Everything seemed to install successfully including SSMS. I was able to connect to the instance locally
    and create a database. However, when I tries to connect from a client PC, I got the "not configured for remote connections" error. I went into Configuration Manager on the server and saw that that SQL Browser was stopped. But the Start Service option
    was grayed out. How can I enable SQL Browser?
    Darrell H Burns

    Hi, be sure that service is enabled by
    hope it will help you,
    Questo post è fornito &quot;così com'è&quot;. Non conferisce garanzie o diritti di alcun tipo. Ricorda di usare la funzione &quot;segna come risposta&quot; per i post che ti hanno aiutato a risolvere il problema e &quot;deseleziona
    come risposta&quot; quando le risposte segnate non sono effettivamente utili. Questo è particolarmente utile per altri utenti che leggono il thread, alla ricerca di soluzioni a problemi similari. ENG: This posting is provided &quot;AS IS&quot;
    with no warranties, and confers no rights. Please remember to click &quot;Mark as Answer&quot; on the post that helps you, and to click &quot;Unmark as Answer&quot; if a marked post does not actually answer your question. Please Vote This As
    Helpful if it helps to solve your issue. This can be beneficial to other community members reading the thread.

  • I would like to compare a CSV field "Name" with a SQL Server table field "ResourceName" and write out the person that is not in the SQL server table.

    if (this.DataCenterLaborFileUpload.HasFile)
                    var extension = Path.GetExtension(DataCenterLaborFileUpload.FileName);
                    string currentName = "";
                    decimal currentHours = 0.00M;
                    decimal currentFTE = 0.00M;
                    string ResourceName = "";
                    if (extension == ".csv")
                        StreamReader csvreader = new StreamReader(DataCenterLaborFileUpload.FileContent);
                        DataTable dt = new DataTable();
                        dt.Columns.Add("txtName");
                        dt.Columns.Add("txtHours");
                        dt.Columns.Add("txtFTE");
                        while (!csvreader.EndOfStream)
                            DataRow dr = dt.NewRow();
                            var line = csvreader.ReadLine();
                            var values = line.Split(',');
                            if (values[0].Trim() != "Pers.No.")
                                using (DbConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLStaffingConn"].ConnectionString))
                                    conn.Open();
                                    using (DbCommand cmd = conn.CreateCommand())
                                        cmd.Connection = conn;
                                        cmd.CommandText = "SELECT ResourceName FROM
    StaffTracking  order by PersonnelResourceType, ResourceName";
                                     //   DbParameter p1 = cmd.CreateParameter();
                                     //   p1.ParameterName = "restype";
                                     //   p1.Value = "Supplier";
                                     //   cmd.Parameters.Add(p1);
                                        using (DbDataReader row = cmd.ExecuteReader())
                                            while (row.Read())
    ResourceName = row.GetString(0);
    if (ResourceName != (values[1].Trim()))
    if (values[1].Trim() == currentName)
    currentHours = currentHours + Convert.ToDecimal(values[9].Trim());
    else
    if (currentName == "")
    dr["txtName"] = currentName;
    dr["txtHours"] = currentHours;
    dr["txtFTE"] = currentFTE + Math.Round(currentHours / (weekdaysInMonth() * 8), 2);
    dt.Rows.Add(dr);
    dt.AcceptChanges();
    currentHours = Convert.ToDecimal(values[9].Trim());
    currentName = values[1].Trim();
                        DataRow drfinal2 = dt.NewRow();
                        drfinal2["txtName"] = currentName;
                        drfinal2["txtHours"] = currentHours;
                        drfinal2["txtFTE"] = currentFTE + Math.Round(currentHours / (weekdaysInMonth() * 8), 2);
                        dt.Rows.Add(drfinal2);
                        dt.AcceptChanges();
                        gvDataCenterLabor.DataSource = dt;
                    gvDataCenterLabor.DataBind();
                    //     Page.DataBind();
    Here is my csv file:
    Pers.No.
    Name
    HomeFID
    Copy Range/Value from Column V
    Worked Date
    Job Code
    Account
    Pay Type
    Activity Type
    Hours
    11111111
    Doe Jane
    USA7064810
    US1-08333.01.08.02.03
    20150223
    00S15H
    9.61E+09
    410
    8
    11111111
    Doe John
    USA7064810
    US1-08333.01.08.02.03
    20150210
    00S15H
    9.61E+09
    410
    9
    11111111
    Smith Jane
    USA7064810
    US1-08333.01.08.02.03
    20150226
    00S15H
    9.61E+09
    410
    8
    So if Doe Jane is not in the SQL table I would like to only display her.
    It's only displaying the ones from the CSV file that are in the SQL Table.
    Thanks

    Hi
    Please use this insert
    code button to provide code next time. It could better to help us to review  your code.
    Now let's focus your question, I have tried to test with your code. But failed.
    I would suggest that you could export columns "Name" and "ResourceName" to DataTable.
    Then use DataTable to compare and filter with its column value.
    Here is a helpful reference:
    Comparingtwo DataTables by specific
    column in C# [closed]
    Best regards,
    Kristin
    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.

  • Add does not run with sql server 2008

    Hi all,
    My add on in the development environment does not run with SQL SERVER 2008. It ran well with SQL Server 2005 and sap b1 2207 B.
    On executing the project file system throws an error "YOU ARE NOT CONNECTED TO THE COMPANY"
    we are trying this scenario on a test machine where SAP B1 2007B with temporary license for one month and SQL server 2008
    is installed.
    Help needed.
    Thanking you
    Pradnya

    Hi Use this
    Dim i as integer
    i=oCompany.Connect()
    if i<> 0 Then
    msgbox(ocompany.GetLastErrorDescription ())
    end if
    the you will get the error description also use try catch wherever necessary
    Alternatively you can use
    Dim SboGuiApi As SAPbouiCOM.SboGuiApi
    Dim sConnectionString As String
    Set SboGuiApi = New SAPbouiCOM.SboGuiApi
    sConnectionString = Command
    SboGuiApi.Connect sConnectionString
    Set SBO_Application = SboGuiApi.GetApplication()
    Set ocompany = New SAPbobsCOM.Company 'initialate DI company object
      ocompany = SBO_Application.Company.GetDICompany
    HTH,
    Atul

  • LIKE operator is not working in SQL Query in XML file

    Hi Gurus,
    LIKE operator is not working in SQL query in XML template.
    I am creating a PDF report in ADF using Jdeveloper10g. The XML template is as follows
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <dataTemplate name="catalogDataTemplate" description="Magazine
    Catalog" defaultPackage="" Version="1.0">
    <parameters>
    <parameter name="id" dataType="number" />
    <parameter name="ename" dataType="character" />
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[
       SELECT ename, empno, job, mgr from EMP where deptno=:id and ename LIKE :ename || '%']]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="EmployeeInfo" source="Q1">
    <element name="EmployeeName" value="ename" />
    <element name="EMPNO" value="empno" />
    <element name="JOB" value="job"/>
    <element name="MANAGER" value="mgr" />
    </group>
    </dataStructure>
    </dataTemplate>
    if i pass the parameter value of :ename from UI, it doesn't filter. But if I give ename = :ename it retrieves the data. Can anyone help me why LIKE operator doesn't work here?
    Appreciate your help,
    Shyamal
    email: [email protected]

    Hi
    Well for a start, you are doing some very strange conversions there. For example...
    and to_char(a.msd, 'MM/DD/YYYY') != '11/11/2030'
    and to_char(a.msd, 'MM/DD/YYYY') != '10/10/2030'If a.msd is a date then you should e converting on the other side ie.
    and a.msd != TO_DATE('11/11/2030', 'MM/DD/YYYY')
    and a.msd != TO_DATE('10/10/2030', 'MM/DD/YYYY')Also, you may want to take into consideration nothing being input in :P2_ITEM_NUMBER like this...
    AND INSTR(a.item_number,NVL(:P2_ITEM_NUMBER,a.item_number)) > 0Is item number actually a number or char field? If it's a number, you want to explicitly convert it to a string for using INSTR like this...
    AND INSTR(TO_CHAR(a.item_number),NVL(TO_CHAR(:P2_ITEM_NUMBER),TO_CHAR(a.item_number))) > 0?
    Cheers
    Ben

  • EXEC SP_EXECUTESQL not working in sql server 2014

    EXEC SP_EXECUTESQL not working in sql server 2014

    EXEC SP_EXECUTESQL not working in sql server 2014
    Hi Amar,
    What's the error when executing this stored procedure?
    I have tested it on my local environment, we can run this SP without any problems.
    Please provide us more information, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • SET NULL not working in SQL*Plus

    DB Version: 10.2.0.4
    Question1.
    Won't SET NULL work with PL/SQL block?
    Question2.
    Why is <<>> appearing in several lines (one character per line) as shown below? Sorry about the "jive-quote" thing below, got that after i added code tags.
    SQL > show lines
    linesize 80
    SQL > show pages
    pagesize 14
    SQL > set null <<>>
    SQL > select null from dual;
    N
    <
    <
    >
    >
    SQL > set serveroutput on
    SQL > declare
      2  v_Val VARCHAR2(100) :='COCOJUMBO';
      3  BEGIN
      4  SELECT null INTO v_val from dual ;
      5  DBMS_output.put_line(v_val);
      6  EXCEPTION
      7  WHEN NO_DATA_FOUND THEN
      8  dbms_output.put_line('Exception:'||SQLERRM);
      9  END;
    10  /
    PL/SQL procedure successfully completed.
    SQL >

    user872043 wrote:
    DB Version: 10.2.0.4
    Question1.
    Won't SET NULL work with PL/SQL block?No. SET NULL is a SQL*Plus command, not a PL/SQL command.
    Question2.
    Why is <<>> appearing in several lines (one character per line) as shown below? Sorry about the "jive-quote" thing below, got that after i added code tags.That's due to default formatting. For example:
    SQL> SET NULL <<>>
    SQL> SELECT NULL FROM DUAL;
    N
    <
    <
    >
    >
    SQL> COLUMN col FORMAT A4
    SQL> SELECT NULL col FROM DUAL;
    COL
    <<>>

  • P/SQL Not Working in SQL Developer

    The following P/SQL seems to work fine in SQL Plus but does not run in SQL Developer
    insert /*+ append */ into upl_exclude_claims
    (select /*+ ordered parallel(s,4) parallel(claim,4) */
    /*+ use_hash(s,claim) no_index(claim, xbm_clm_recip) */
    s.recip,
    s.month_1st_day
    from lrx.upl s,
    mcd.fact claim;
    Thanks

    911105 wrote:
    The following P/SQL seems to work fine in SQL Plus but does not run in SQL Developer
    insert /*+ append */ into upl_exclude_claims
    (select /*+ ordered parallel(s,4) parallel(claim,4) */
    /*+ use_hash(s,claim) no_index(claim, xbm_clm_recip) */
    s.recip,
    s.month_1st_day
    from lrx.upl s,
    mcd.fact claim;
    ThanksWhat happens when you run it? Do you get an error or does nothing happen?
    If you get an error post the message
    Why didn't the first answer I did to this question post???

  • (Substitution Variables) not working in "SQL Developer" Environment !!!!!!!

    this photo illustrate how that (Substitution Variables) not working in "SQL Developer" Environment :-
    http://www.imagehosting.com/show.php/1555180_ddddd.PNG.html
    any solve for this problem ?????!!!!!!!!!!

    There is a dedicated forum for SQL Developer related questions
    SQL Developer
    I should admit however, that query you have provided ( with substitution variables) works like a charme in my environment (SQL Developer 1.1.0.23 build 23.64)
    Best regards
    Maxim

  • Commit Not Working in SQL (but works from icon)

    I can't figure this one out. When I write a script I am not getting a commit even though in the statement output it says "committed". However with the very same sql if I take the commit out and just run the statement and then use the commit icon it works. For example this will not commit from sql
    delete
    from
    test_table
    where user_id = 'abc123';
    commit;
    But if I run it like this and click the commit icon it does:
    delete
    from
    test_table
    where user_id = 'abc123'
    Any info much aprreciated

    How are you running it? If you use F9 (or the green arrow) it will only run one statement.
    If you use F5 (or the green arrow with a piece of paper behind it) it will run the whole worksheet ( or the selected area) as a script.
    If both statements are running you should see
    x rows deleted.
    Commit succeeded.

Maybe you are looking for

  • Function module to get Conditions based on Customer & Material

    Hi, Is there any function module such that the list of conditions are displayed, based on Customer & Material given? Thnx in advance, Shivaa.....

  • Another Display problem! :(

    Looking for some advice! My unibody macbook has a very touchy display. Basically, if it tilts any further back than 90 degrees, the display will freeze (also if I close the lid). If I startup the computer with the lid propped further back, it'll say,

  • Is Apple TV going to get Amazon Prime?

    Is Apple TV going to get Amazon Prime?

  • Export failure in Premiere CS5

    Jello, I am trying to export a large project (Full HD video of 134 minutes) and Premiere crashes when I am trying to export. If I try to export much smaller clips, I don't have problem. Would you happen to know what might be wrong? Thanks

  • Servlet Failed to preload on Startup - WebLogic 8.1

    Hi there, I am getting the following error message when I start up my application in WebLogic. (see below my post for execat error). I only get this when I try to run my application as a .WAR file. If I expand the .war file and run it that way, every