How can Get YTD in Trial Balance Custome In my query

Hello
can any body help me in this query i need to get Ytd trial Balance
/* Formatted on 2011/10/31 12:59 (Formatter Plus v4.8.8) */
SELECT ACCOUNT, descacc, NVL (SUM (opening_balance), 0) opening_balance,
NVL (SUM (debit), 0) debit, NVL (SUM (credit), 0) credit,
NVL (SUM (ending_balance), 0) ending_balance, parent1, parent2,
parent3, parent4, parent5, :from_date,:chartid,:TO_DATE
FROM (SELECT m.segment5 ACCOUNT, w.description descacc,
(NVL (SUM (l.entered_dr), 0) - NVL (SUM (l.entered_cr), 0)
) opening_balance,
NULL debit, NULL credit, NULL ending_balance,
SUBSTR (m.segment5, 1, 1) || '0000000' parent1,
SUBSTR (m.segment5, 1, 2) || '000000' parent2,
SUBSTR (m.segment5, 1, 3) || '00000' parent3,
SUBSTR (m.segment5, 1, 4) || '0000' parent4,
SUBSTR (m.segment5, 1, 5) || '000' parent5
FROM gl_code_combinations m,
gl_je_batches c,
gl_je_categories n,
gl_je_headers h,
gl_je_lines l,
gl_ledgers t,
fnd_flex_values_vl w
WHERE h.default_effective_date < :from_date
AND m.chart_of_accounts_id = :chartid
AND h.je_header_id = l.je_header_id
AND h.je_batch_id = c.je_batch_id
AND l.code_combination_id = m.code_combination_id
AND m.chart_of_accounts_id = t.chart_of_accounts_id
AND h.currency_code IN 'SAR'
AND l.ledger_id = t.ledger_id
AND h.je_category = n.je_category_name
AND h.status = 'P'
AND w.flex_value = m.segment5
AND w.flex_value_set_id = 1014551
GROUP BY m.segment5, w.description
UNION ALL
(SELECT m.segment5 ACCOUNT, w.description descacc,
NULL opening_balance, NVL (SUM (l.entered_dr), 0) debit,
NVL (SUM (l.entered_cr), 0) credit, NULL ending_balance,
SUBSTR (m.segment5, 1, 1) || '0000000' parent1,
SUBSTR (m.segment5, 1, 2) || '000000' parent2,
SUBSTR (m.segment5, 1, 3) || '00000' parent3,
SUBSTR (m.segment5, 1, 4) || '0000' parent4,
SUBSTR (m.segment5, 1, 5) || '000' parent5
FROM gl_code_combinations m,
gl_je_batches c,
gl_je_categories n,
gl_je_headers h,
gl_je_lines l,
gl_ledgers t,
fnd_flex_values_vl w
WHERE h.default_effective_date BETWEEN :from_date AND :TO_DATE
AND m.chart_of_accounts_id = :chartid
AND h.je_header_id = l.je_header_id
AND h.je_batch_id = c.je_batch_id
AND l.code_combination_id = m.code_combination_id
AND m.chart_of_accounts_id = t.chart_of_accounts_id
AND h.currency_code IN 'SAR'
AND l.ledger_id = t.ledger_id
AND h.je_category = n.je_category_name
AND h.status = 'P'
AND w.flex_value = m.segment5
AND w.flex_value_set_id = 1014551
GROUP BY m.segment5, w.description)
UNION ALL
(SELECT m.segment5 ACCOUNT, w.description descacc,
NULL opening_balance, NULL debit, NULL credit,
(NVL (SUM (l.entered_dr), 0) - NVL (SUM (l.entered_cr), 0)
) ending_balance,
SUBSTR (m.segment5, 1, 1) || '0000000' parent1,
SUBSTR (m.segment5, 1, 2) || '000000' parent2,
SUBSTR (m.segment5, 1, 3) || '00000' parent3,
SUBSTR (m.segment5, 1, 4) || '0000' parent4,
SUBSTR (m.segment5, 1, 5) || '000' parent5
FROM gl_code_combinations m,
gl_je_batches c,
gl_je_categories n,
gl_je_headers h,
gl_je_lines l,
gl_ledgers t,
fnd_flex_values_vl w
WHERE h.default_effective_date <= :TO_DATE
AND m.chart_of_accounts_id = :chartid
AND h.je_header_id = l.je_header_id
AND h.je_batch_id = c.je_batch_id
AND l.code_combination_id = m.code_combination_id
AND m.chart_of_accounts_id = t.chart_of_accounts_id
AND h.currency_code IN 'SAR'
AND l.ledger_id = t.ledger_id
AND h.je_category = n.je_category_name
AND h.status = 'P'
AND w.flex_value = m.segment5
AND w.flex_value_set_id = 1014551
GROUP BY m.segment5, w.description))
GROUP BY ACCOUNT, descacc, parent1, parent2, parent3, parent4, parent5
ORDER BY ACCOUNT,parent5
thanks

Thanks a lot for your reply.
I think I should have a database as a service trial.
I can't find service instance in my service.
I want to connect it by java application, but I can't get the service instance name.
Could you please tell me how to get the service instance?
Thanks a lot,
Amanda

Similar Messages

  • Is there anyway I can get buy a Moto X customized phone?  I spent most of the day talking with Motorola and Verizon.. it seems the two companies need to have a chat on how  to freakn work together to order this phone online. I feel like a bunch of demento

    Is there anyway I can get buy a Moto X customized phone?  I spent most of the day talking with Motorola and Verizon.. it seems the two companies need to have a chat on how  to freakn work together to order this phone online. I feel like a bunch of dementors sucked the life outta me, I need chocolate and alcohol to help me feel better... eeeek!

    One thing that I finally had to do when I got my phone on MotoMaker was to buy it outright, after getting an account with Motorola--that way I could get a customized one with 32GB storage.  I recall that I could not get it in that size with the usual contract term with Verizon.  The Edge option for some reason was not available to me either, don't recall why.
    But by buying it through Motorola credit, I could spread the purchase price over 12 months--kind of Edge lite.  Then when my contract status changed over to month-to-month instead of the old-fashioned 2 year system, my line charges went down to $15 per month,  as it would using the Edge option. 

  • How can I add a new message(custom text message) to the holiday approval em

    How can I add a new message(custom text message) to the holiday approval email-notification sent to the manager?
    TIA

    The answer is 'not very easily', unless the information you want to display is the employee's leave balances. In 12.1.3 Oracle have delivered functionality that allows you to include the leave balances in the approval notifications out-the-box, ie, without customization.
    For any other information you're probably going to have to customize the standard delivered HRSSA workflow. Within this workflow, the Leave of Absence functionality uses the Notify Approver (Embedded) (HR_APPROVER_NTF) notification. The body of this notification is set to the Notify Approver (Embedded) (HR_NTF_EMBEDDED_REGION) attribute. This in turn defaults to:
    JSP:/OA_HTML/OA.jsp?OAFunc=-&HR_EMBEDDED_REGION-&NtfId=-&#NID-
    So essentially you can change the HR_APPROVER_NTF notification. The problem with changing this notification is that it's generic - it's used for all SSHR functions and not just Leave of Absence. That means you have to make other, more substantial, customizations to the workflow to ensure the changes you make only applies to LOA.
    The other option is to personalize the review page (ie, the region referenced in &HR_EMBEDDED_REGION) to include whatever messages you want. But that means they'll appear on the Review page and all LOA approval notifications and that might not be what you want.
    It's usually better to live with what Oracle deliver and find an alternative solution! What's the content of the message you want to include?

  • How can I edit or delete a custom label in the contacts list on iOS 7 on iPhone 4S ?

    How can I edit or delete a custom label in the contacts list on iOS 7 on iPhone 4S ?

    Alfre311 wrote:
    I've been trying to find a way to do this since I updated to IOS 7, and I've just found the solution/explanation, even tho is a bit heavy to carry out.
    IOS 6 creates custom labels and save them giving you the option to delete them.
    IOS 7 creates custom labels but don't save them, so there is no need to have the option to delete them.
    But here comes the problem, if you have some custom labes saved in you Iphone / Ipad with IOS 6 and you update it to IOS 7, the device will keep those labels saved, but you wont be able to delete them.
    I realized this by going to contacts on Icloud. There those labels that I had on my devices weren't there. So simply restoring your device and configuring it as a new one to later sync your Icloud Contacts, will solve the problem.
    I know this post is old, but I might just try this with iOS 8. I have outdated custom labels that annoy me, because I still seem them in the list as options. If I get desperate enough, I may try your solution.

  • How can i find out the balance of a itunes gift card without redeeming it?

    How can i find out the balance of a itunes gift card without redeeming it??

    Hello,
    You can get more information regarding to your problem here : http://support.apple.com/kb/ht5035
    All the best !

  • How can I check my outstanding balance for apps I've downloaded so I can clear it so I can update my apps?

    How can I check my outstanding balance for apps I've downloaded so I can clear it so I can update my apps?

    I believe the item will get automatically charged to the credit unless it is an item for which such a payment method is not valid (e.g., a gift card).
    Showing account balance in iTunes and on a mobile device - https://discussions.apple.com/message/20443884

  • How can start the free trial of adobe captivate 8

    how can start the free trial of adobe captivate 8

    Hello,
    Welcome to Adobe Forums !
    You may simply download using the link below
    https://www.adobe.com/cfusion/tdrc/index.cfm?product=captivate
    If you need any help while doing this you may Contact Customer Care .
    Thanks
    Himanshu

  • How can i clear my account balance to $0.00 to change my country?

    how can i clear my account balance to $0.00 to change my country? thanks for help

    carlo243828 wrote:
    how can i clear my account balance to $0.00 to change my country?
    To do this... Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • How can i extend my trial version of dreamweaver? I had it downloaded for over a month and did not know it

    how can i extend my trial version dreamweaver?

    Purchase a Creative Cloud plan and make use of the 30 day option to not proceed. Under the generous Adobe conditions, you will get your money refunded.

  • How can i view and apply new custom patterns without going to preset manager? i had this facility but have now lost it

    how can i view and apply new custom patterns without going to preset manager? i had this facility but have now lost it.  i design patterns but am fairly new to photoshop. i used to be able to click on the drop down menu in patterns in the 'fill' box but cannot now do this.  have i inadvertently clicked on something to turn this facility off?  i now have to go to 'preset manager' and manually move my new design to the first box and click 'done' so that i can use it.

    Which version of photoshop are you using?
    After you define a custom pattern it should be added to the bottom of whatever patterns are already loaded.
    For example, if you define a custom pattern and then go to Edit>Fill>Pattern, the newly defined pattern should have been added to the existing loaded patterns.

  • My Apple TV was set up with a different Apple ID than I have for my ITunes Account.  In other words I have multiple Apple ID's.  How can get these accounts to sync up?

    My Apple TV was set up with a different Apple ID than I have for my ITunes Account.  In other words I have multiple Apple ID's.  How can get these accounts to sync up?

    If you wish to use home sharing then you need to setup the Apple TV under your ID.

  • *** How to get the username in a custom password change routine....

    How to get the username in a custom password change routine / procedure / form when a user's password has expired and is redirected automatically to this custom program?
    We use the 2nd parameter in LOGIN_URL column in WWSSO_LS_CONFIGURATION_INFO$ table to get to this custom change-password proc.

    OK !
    Use that maybe good :
    select USERID into v_user from sys.aud$
      where ntimestamp#=(
      select max(ntimestamp#)
      from sys.aud$ );

  • Hello, How can I edit or delete a custom label in the contacts list on iOS 7.0.3 on iPhone 4S ?

    Hello, How can I edit or delete a custom label in the contacts list on iOS 7.0.3 on iPhone 4S ?
    i need it so muchhh!

    Sort of depend on what you are trying to do precisely. In Edit mode, if you tap on any label, you will be given a list of options, plus an Add Custom Label option near the bottom of the list

  • I loos my APPLE ID, I have a new one, how can get access to data stored in the old one?

    I loos my APPLE ID, Now I have a new one, how can get access to data stored in the old one?

    Do you have the email & password of the old Apple ID?

  • Imported slide show into PE11 and some pics rotated unexpectedly, How can get back to horizontal?

    Imported slide show into PE11 and some pics rotated unexpectedly, How can get back to horizontal?

    winkhi
    Just what are the pixel dimensions of these photos that are automatically rotating on you in Premiere Elements 11 workspace after being transferred there from the Elements Organizer Slideshow Editor? Do I have that correct? If so, how are you making the transfer....Edit with Premiere Elements Editor, Burn to Disc, or other as Elements Organizer 11 Slideshow Editor output?
    What is the scenario...from the camera to the computer hard drive, landscape; from the computer hard drive to the Elements Organizer 11 Slideshow Editor, landscape; from the Elements Organizer 11 Slideshow Editor to Premiere Elements 11 Project Assets/Timeline, rotated to Portrait?
    Do you find that the frequency of the problem is related to pixel dimensions, number of photos used? What is the format of these photos, jpg or other?
    Are you using the Rotation option in the Applied Effects Tab/Applied Effects Palette/Motion Panel expanded to correct the photo rotation?
    Just some thoughts for now.
    ATR
    ATR

Maybe you are looking for