Help me show rowcount of a cursor on forms canvas,,

i mean..
The program unit is not in the forms application but in the oracle server side.
i need to show a cursor's rowcount on forms canvas
while a cursor is running loop in the program unit in real-time..
so i used the when-timer-expired trigger that reads a data(related record count from some table) every 1second.
i hoped that the timer trigger synchrozes with the server program unit.
but there was only one time event when the server program unit has finished.
How can i resolve the problem..??

duplicate
i try to display a number of executed record on the forms screen.
Please do not create a new thread for the same problem.

Similar Messages

  • Show explanation text when cursor is set into InputField

    Hi all,
    I have a WDA component with a view that uses UI-elements Label and InputField.
    The InputField has a explanation text. This explanation text is shown only if I´m moving the mouse pointer over the label (label is underlined). Is there a possibility to show the explanation when cursor is set into the input field?
    We´re using SAP NetWeaver 7.0 with EHP 1 and SP 08.
    Any help would be appreciated.
    Alex

    Hi,
    Just put the explanation text into tooltip propery of InputField. It will show the text when the cursor is moved over it.
    Thanks,
    Chandra

  • My new I5 uploaded doubleded all the songs from my library! Please, can somebody help me showing how can I delete just the songs that was doubled?

    Hi there everybody,
    My new Iphone 5 uploaded doubleded all the songs from my library! Please, can somebody help me showing how can I delete just the songs that was doubled?
    Some help will be greatly appreciate.
    Thanks much!

    When you say "account," do you mean your iTunes library, because your iTunes library is what is on your computer?  Your iTunes library does not have an email address.  An account that is related to iTunes is your Apple ID (which is an email address) and you use it as your user name to sign in to the iTunes Store, to make purchases.  Changing your Apple ID will not make songs disappear from your computer's iTunes library.
    If you had an Apple ID and used it to make song purchases from the iTunes Store, and then started using a different Apple ID, you should be able to re-download the songs purchased with the old Apple ID.  In iTunes, sign in to the iTunes Store using your OLD Apple ID (and password).  That may not be your current email address, but Apple uses it as your user name, so it does not matter.
    On the iTunes Store Home screen, click on Purchased under QUICK LINKS.  This takes you do the Purchased screen, where you can re-download previous song purchases (for that Apple ID) at no cost. 
    NOTE:  If those song purchases are from more than a few years ago, you may also need to authorize your computer to play (and sync) songs for your old Apple ID. 
    For songs that were not purchased from the iTunes Store, if they are also gone, you cannot get them back unless you have a backup (or they are still loaded on your old iPod).
    If that's not what you mean by "changed the email address on my account," please post back with more details.

  • Need help on Dynamic SQL Cursor in Forms

    Hi All,
    I am trying to execute Dynamic SQL Cursor in forms using EXEC_SQL built in.
    I have a cursor for example:
    'select * from supplier where supplier = '||p_supplier||' and processing_order = '||p_order
    My code is
    cur_num := Exec_SQL.Open_cursor;
    sql_order := 'select * from supplier where supplier = '||p_supplier||' and processing_order = '||p_order;
    EXEC_SQL.PARSE(cursor_number, sql_order);
      EXEC_SQL.DEFINE_COLUMN(cur_num ,1,ln_Supp_Id);
      EXEC_SQL.DEFINE_COLUMN(cur_num ,2,ls_Suppl_Name,30);
    EXEC_SQL.DEFINE_COLUMN(cur_num ,24,ls_exchange,20);
      sql_count := EXEC_SQL.EXECUTE(cur_num );
      While EXEC_SQL.FETCH_ROWS(cur_num ) > 0 Loop
            EXEC_SQL.COLUMN_VALUE(cur_num ,1,ln_Supp_Id);
            EXEC_SQL.COLUMN_VALUE(cur_num ,2,ls_Suppl_Name);
            EXEC_SQL.COLUMN_VALUE(cur_num ,24,ls_exchange);
    End Loop;
    EXEC_SQL.CLOSE_CURSOR(cur_num );
    In this case I have to write 24 Define Columns and 24 Column value. Is there any way to assign them to %rowtype at one time as I need all coulmn of the table.
    I had similar case on multiple tables.
    Please help me
    Thanks,
    Maddy

    I need this dynamic sql because p_supplier and p_order values changes at run time
    I do not understand. Is this a simplified sample or the real thing? You do know that you can pass variables to cursors:
    cursor test is
    select * from supplier where supplier = p_supplier and processing_order = p_order;
    or does e.g. p_supplier hold other parts of the query?
    cheers

  • My iphone 3gs is in recovery mode how do i activate it please help. it shows the message your iphone couldnot be activated because the activation server is temporarily deactivated.

    my iphone 3gs is in recovery mode how do i activate it please help. it shows the message your iphone couldnot be activated because the activation server is temporarily deactivated.

    This usually happens if the phone has been Hacked / Jailbroken / Modified...
    Is this the case...?

  • Help to show a HTML file in Swing

    Hiiiiiiiiiii,
    During my development Me in a problem . Please help me out.
    As per my current context of the project I have to develop a HTML page with Help of CSS and all other things. After that I have to Show the HTML file through Swing. I know how to attach a file with help of URL but need some help to show a HTML file in Swing.
    *help to show a HTML file in Swing*

    As camickr said Javascript support is not available. If you want to support you have to write code for that. Up to an extent CSS support is provided.
    Sample code to display HTML pages in JTexPane (you can use JEditorPane as well):
    Construct the URL:
    URL url = YourClass.class.getResource("resources/Hello.html");
    // If YourClass is in package test.html, then your html page must be available in .....test/html/resources directory.
    // And your CSS files must be accessible from your HTML page. This you can test by simply opening the html
    // page in your favorite browser.And then call setPage() method of HelpDataPane. Note that, HelpDataPane supports hyperlink activation.
    import java.io.IOException;
    import java.net.URL;
    import javax.swing.JTextPane;
    import javax.swing.event.HyperlinkEvent;
    import javax.swing.event.HyperlinkListener;
    * A pane to display help pages. Help pages are accessed as URL and displayed
    * in this pane.
    * @author Mrityunjoy Saha
    * @version 1.0
    public class HelpDataPane extends JTextPane {
         * Creates a new instance of {@code HelpDataPane}.
        public HelpDataPane() {
            super();
            this.addHyperlinkListener(new HyperlinkListener() {
                public void hyperlinkUpdate(HyperlinkEvent e) {
                    if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
                        setPage(e.getURL());
         * Sets the current URL being displayed.  The content type of the
         * pane is set, and if the editor kit for the pane is
         * non-{@code null}, then
         * a new default document is created and the URL is read into it.
         * @param page The URL to be displayed.
        @Override
        public void setPage(URL page) {
            try {
                super.setPage(page);
            } catch (IOException ex) {
                try {
                    URL blankURL = YourClass.class.getResource("resources/Blank.html");
                    super.setPage(blankURL);
                } catch (IOException ioe) {
                    ioe.printStackTrace();
    }Thanks,
    Mrityunjoy

  • Hierarchy node Variable: F4 Help - Not showing Master data values

    Hi,
    We're having some problems trying to display the F4 help of a hierarchy node selection variable, to show the master data values so that it would look more complete for the users during report execution.
    In the RSD1 setting for the info object, under 'Business Explorer' tab, the 'Query Execution Filter Val. Selectn' is set to 'Only Posted Values for Navigation'.
    I thot that we could overwrite this setting at the Query Designer level, but it does not seem to work.
    Even tho in the Query Designer, we have already specified the 'Filter Value Selection During Query Execution' to 'Values in Master Data Table', it does not seem to display the master data values.
    There is no difference in the F4 values being displayed for the hier node variable, before and after the change in Query Designer.
    Could anyone share some tips on other possible solutions to get a hier node selection variable's F4 help to show the master data values, without changing the RSD1 setting at the info object level please ?
    Thanks in advance for your help.
    Regards,
    Femmie.

    Hi,
    Could you please share the steps you have taken to fix the problem?
    We do have a similar problem and for some reason the newly added hierarchy node for 0Profit_ctr is not showing up in the variable selection screen F4 (input selection for query execution). However we can see this node when we display that hierarchy in RSA1. I did try applying the changes recommened by Jerome but unfortunately it didn't work.
    Any help on this would be greatly appreciated.
    Thanks,
    Krish

  • 3.2.09.30 on Win 7 (64bit) -- help not showing up

    Nothing is showing up from either Help->Search or Help->Table of Contents. A task named "Help Center" does appear in task manager but switching to that task has no noticable affect.
    As indicated in the subject, this is a new install of 3.2.09.30 on a Windows 7 64bit O/S. However, just before posting this I decided to try it from the previous SQL Developer version (3.1.07.42) which I still had installed and the same thing happened there. That explains why I didn't see anyone else complaining about it.
    Still.... I would welcome any ideas on how to diagnose/fix it. The problem with the Help not showing up is the only issue I have noticed.
    Edited by: Brad_Peek on Sep 2, 2012 8:08 PM

    Hi Brad,
    Have you at some stage had a second monitor screen connected to your computer?
    If so, then one possibility is that you displayed SQL Developer Help on that second monitor. Next time you use Help it will attempt to display it in the same place (even if the monitor is no longer connected).
    I believe when you upgrade from version 3.1.07.42 to 3.2.09.30 it will preserve this setting.
    To make it visible again, you can either reconnect the second monitor, or you can move the Help window back onto the main screen as follows:
    1. Bring up the Help Center (so that it should be the active window)
    2. Type Alt Space (This opens the drop-down menu for the window.)
    3. Type M (This selects the Move option on the drop-down menu.)
    4. Use the left or right arrow key to move the window. (Once you've started this, you will find that you can use the mouse to position the window on the screen.)David

  • I have CS2 but my help menu shows up as Photoshop Elements

    I have CS2 but my help menu shows up as Photoshop Elements. Does any one know what the issue is?

    THANK YOU CHRIS!
    You solved my problem. I did have one unused language defined, i thought i needed 2 languages but apparantly i don't, because my DVD now works fine.
    It was very hard to trace the problem because the whole concept of languages and menus is still sort of unclear to me. I guess i need to do some studying on that. The DVDP manual sadly lacks a good tutorial on how to set up a multi-lingual DVD with multiple subtitle streams.
    Now i've set up 2 menus for each version (the movie with and without subtitles), only one language and all is well.
    One thing still puzzles me: The first version (the one with the unusued language) did play fine on a G4 with Panther. The white menus showed up on a G5 with Tiger and on my standalone DVD-players. So somehow Quicktime also plays a role in this. The fact that this is a DVD9 has nothing to do with it. Thanks again.

  • Use of Cursors in Forms!!

    Hi all,
    Here i want to write a generic procedure, which creates a cursor with query based on the users' choice of table and the given query....
    the procedure looks like the following....
    Procedure xyz(iv_table_name IN VARCHAR2,
    iv_where_condition IN VARCHAR2)
    IS
    Cusor lcur_generic IS
    Select field1, field2
    from <iv_table_name> -- Here i want to use the above parameter..
    and i want to attach the iv_where_condition string
    as where condition...
    Could any one help me in this issue,
    It is very important and urgent
    I'm Using Forms 6
    Help is appreciated.
    Tnx
    RK Raju

    IN THE FORMS PREPARE THE STATEMENT
    :BLOCK1.DT:='SELECT FIELD1,FIELD2,FIELD3,FIELD4 FROM TABLE1 WHERE FIELD1=XXX';
    THEN YOU CAN CALL THE PROCEDURE
    IN THE BLOCK PROPERTIES INSTEAD OF TABLE USE PROCEDURE
    QUERY DATA SOURCE NAME 'CUR.RCURSOR'
    QUERY DATA SOURCE COLUMNS
    SET FIELD1 TYPE VARCHAR2 ......
    FIELD2 TYPE VARCHAR2 ......
    FIELD3 TYPE VARCHAR2 ......
    FIELD4 TYPE VARCHAR2 ......
    QUERY DATA SOURCE ARGUMENTS
    SET RESULTSET TYPE REFCURSOR
    TYPE NAME CUR.FINSTYPE
    MODE INOUT
    DT TYPE VARCHAR2
    MODE IN
    VALUE :BLOCK1.DT
    THIS WILL WORK ON THE BLOCK EXECUTE QUERY
    MAKE SURE THE FIELD1,FIELD2,FIELD3,FIELD4 ARE DATABASE SET TO YES
    HERE IS THE CODE FOR THE PACKAGE YOU NEED TO CREATE..
    Package CUR /* IF YOU USE authid current_user */ IS
    type FINSTYPE is ref cursor ;
    PROCEDURE RCUR(RESULTSET IN OUT finstype,DT IN VARCHAR2 );
    END CUR;
    -------------------------------BODY-------------
    Package CUR
    IS
    PROCEDURE RCUR(RESULTSET IN OUT FINSTYPE ,DT VARCHAR2 )
    IS
    BEGIN
    OPEN RESULTSET FOR
    DT;
    EXCEPTION WHEN OTHERS THEN
    NULL;
    END;
    END ;
    IF YOU
    DECLARE
    FCURSOR CUR.FINSTYPE;
    STATEMENT1 VARCHAR2(2000):='SELECT FIELD1,FIELD2,FIELD3,FIELD4 FROM TABLE1 WHERE FIELD1=X';
    BEGIN
    CUR.RCUR(FCURSOR,STATEMENT1);
    FETCH ..... LOOP
    END LOOP;
    CLOSE STATEMENT1;
    END;
    THIS WILL WORK INSIDE OTHER PROCEDURES OR FUNCTIONS BUT NOT INSIDE FORMS PLSQL.
    TO WORK INSIDE FORMS PLSQL
    YOU HAVE TO CREATE IN THE PACKAGE
    RECORDX OF TYPES FIELD1,FIELD2,FILED3,FIELD4
    AND THEN
    INSTEAD OF
    type FINSTYPE is ref cursor ;
    YOU SAY
    type FINSTYPE is ref cursor OF RECORDX ;
    GOOD LUCK
    I HOPE WHAT I WROTE MAKES SENCE BECAUSE IT WORKS...

  • REF Cursor in Forms 4.5

    I am using forms 4.5. I have a function whcih returns cursor. I would like to store the return values in Forms cursor variable and iterate thru the result set. When I declare TYPE cname IS REF CUROSOR I get compilation error. Is it possible to declare REF CURSOR in forms 4.5 . Help is greatly appreciated

    Thanks. Is there any way I can capture the ref curosr (or resultset) passed from server from the oracle forms. The purpose is to call the function from the forms with a table id which will return a resultset which is the items in the list , which is used to populate list in forms. To have a centralised location for list elements.
    Is there any package on forms which can be used to capture the returned resultset, pl. let me know

  • How can we restrict the f4 help from check table in the pop up form.

    Hi,
    I am trying to control the F4 help values from check table coming in the form of pop up.

    When a user uses SM30 to add an entry into table, you often need to add more checks. If you were to add code inside, there is a big chance that it would be overwritten.
    The solution: go to table maintenance generator ( se56) => Enviroment => add event.
    [To add event in table main.|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-8765287250fc]

  • How to show a time field in a form portlet

    Hi,
    I am not familiar with PL/SQL and I was wondering how I could show a time field on a form portlet.
    I have a date column in my database that stores the time and date together, but I do not know how to separate them into date and time fields. I also do not know how to concatenate them when a user inserts a new record, or how to query on a date alone.
    At present, the user has to type the date and time following this format mask hh:mi am DD/Mon/RR
    I also have a problem with one of my hidden id fields. I have set the default to a sequence.nextval (#qtc_app.seq_visitor.nextval) and then hidden it since
    it is irrelevant to my users. However, I can no longer use the query function since the sequence is always generating a new value. How would I only generate
    a new sequence no. when a user inserts a record??
    Thank you!
    cheers, Kim

    Hi,
    Each colunm in the form has a format mask associated with it. For the date column make the format mask like this DD-MON-RR HH.MI. This will show the date along with the hours and minutes.
    Thanks,
    Sharmila

  • I need help in converting a pdf to a fillable form in my adobe

    I need help in converting a pdf to a fillable form in my adobe

    "Adobe" is a company. If you mean "Adobe Reader" then you can't (at least not easily). You need Adobe Acrobat for that.

  • I Need Help to Access The Source Code From A Form to Know the Calculation Formula

    Hi,
    I Need Help to Access The Source Code From A Form to Know the Calculation Formula. The application is a windows form application that is linked to SQL Server 2008. In one of the application forms it generates an invoice and does some calculations. I just
    need to know where behind that form is the code that's doing the calculations to generate the invoice, I just need to get into the formula that's doing these calculations.
    Thank you so much.

    Hi, 
    Thanks for the reply. This is a view and [AmountDue] is supposed to be [CurrentDueAmount] + [PastDueAmount] - [PaidAmount]. The view is not calculating [PaidAmount] right . Below is the complete code of the view. Do you see anything wrong in the code ?
    Thanks. 
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [iff].[FacilityFeeID], [LoanID] = NULL, [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = [isis_fee].[SectionType], [Name]
    = [iff].[Name], [ReceivedAmount], [dates].[CurrentDueAmount], 
                          [PastDueAmount] = CASE WHEN ISNULL([ReceivedAmount],
    0) > 0 THEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply reset to current. */ CASE WHEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [pastdue].[PastDueFeeAmount]
    + ISNULL([ReceivedAmount], 0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [pastdue].[PastDueFeeAmount] < 0 THEN 0 ELSE
    [pastdue].[PastDueFeeAmount] END, [PaidAmount] = CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([pastdue].[PastDueFeeAmount]
    + ISNULL([ReceivedAmount], 0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [pastdue].[PastDueFeeAmount] < 0 THEN - [pastdue].[PastDueFeeAmount]
    ELSE 0 END, [AmountDue] = [unpaid].[UnpaidFeeAmount], [ID] = [iff].[FacilityFeeID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_FacilityFee] iff ON [if].[ID] = [iff].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_fee].[ID],
    [sis_fee].[SectionTypeCode], [SectionType] = [st_fee].[Name], [sis_fee].[INV_FacilityFeeID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_fee JOIN
                   [dbo].[INV_SectionType] st_fee ON [sis_fee].[SectionTypeCode] = [st_fee].[Code]
                                WHERE      [INV_FacilityFeeID]
    IS NOT NULL AND [StatusCode] = 'BILL') isis_fee ON [iff].[ID] = [isis_fee].[INV_FacilityFeeID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedFeeAmount]), 
                   [ReceivedAmount] = SUM([iffa].[ReceivedFeeAmount])
                                FROM      
       [dbo].[INV_FacilityFeeAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_fee].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     *
                                FROM      
       [dbo].[INV_FacilityFeeAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [SectionID],
    [PastDueFeeAmount] = SUM([PastDueFeeAmount])
                                FROM      
       [dbo].[INV_FacilityFeeAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]
    UNION
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [FacilityFeeID] = NULL, [il].[LoanID], [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = [isis_loan].[SectionType], [Name]
    = [il].[Name], [ReceivedAmount], [CurrentDueAmount], [PastDueAmount] = CASE WHEN ISNULL([ReceivedAmount], 
                          0) > 0 THEN [PastDueAmount] + ISNULL([ReceivedAmount],
    0) WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [PastDueAmount] + ISNULL([ReceivedAmount],
    0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN 0 ELSE [PastDueAmount]
    END, 
                          [PaidAmount] = CASE WHEN [isis_loan].[SectionTypeCode]
    = 'LOAN_PRIN' THEN 0 ELSE CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([PastDueAmount] + ISNULL([ReceivedAmount],
    0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN - [PastDueAmount]
    ELSE 0 END END, 
                          [AmountDue] = CASE WHEN [isis_loan].[SectionTypeCode]
    = 'LOAN_PRIN' THEN [CurrentDueAmount] ELSE [unpaid].[AmountDue] END, [ID] = [il].[LoanID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_Loan] il ON [if].[ID] = [il].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_loan].[ID],
    [sis_loan].[SectionTypeCode], [SectionType] = [st_loan].[Name], [sis_loan].[INV_LoanID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_loan JOIN
                   [dbo].[INV_SectionType] st_loan ON [sis_loan].[SectionTypeCode] = [st_loan].[Code]
                                WHERE      [INV_LoanID]
    IS NOT NULL AND [StatusCode] = 'BILL') isis_loan ON [il].[ID] = [isis_loan].[INV_LoanID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[ExpectedPrincipalAmount]), 
                   [ReceivedAmount] = SUM([ReceivedPrincipalAmount])
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization] iffa
                                GROUP BY [iffa].[SectionID]
                                UNION
                                SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                  [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                  [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID]
                                UNION
                                SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                  [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                  [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_loan].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     [AmountDue]
    = [UnpaidPrincipalAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization]
                                UNION
                                SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual]
                                UNION
                                SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [PastDueAmount]
    = SUM([PastDuePrincipalAmount]), [SectionID]
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization]
                                GROUP BY [SectionID]
                                UNION
                                SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual]
                                GROUP BY [SectionID]
                                UNION
                                SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]
    UNION
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [FacilityFeeID] = NULL, [il].[LoanID], [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = 'PIK Interest Applied', [Name]
    = [il].[Name], [ReceivedAmount], [CurrentDueAmount] = - [dates].[CurrentDueAmount], 
                          [PastDueAmount] = - CASE WHEN ISNULL([ReceivedAmount],
    0) > 0 THEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [PastDueAmount] + ISNULL([ReceivedAmount],
    0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN 0 ELSE [PastDueAmount]
    END, [PaidAmount] = - CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([PastDueAmount] + ISNULL([ReceivedAmount],
    0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN - [PastDueAmount]
    ELSE 0 END, [AmountDue] = - [AmountDue], [ID] = [il].[LoanID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_Loan] il ON [if].[ID] = [il].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_loan].[ID],
    [sis_loan].[SectionTypeCode], [SectionType] = [st_loan].[Name], [sis_loan].[INV_LoanID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_loan JOIN
                   [dbo].[INV_SectionType] st_loan ON [sis_loan].[SectionTypeCode] = [st_loan].[Code]
                                WHERE      [INV_LoanID]
    IS NOT NULL AND [StatusCode] = 'BILL' AND [sis_loan].[SectionTypeCode] = 'LOAN_INT_PIK') isis_loan ON 
                          [il].[ID] = [isis_loan].[INV_LoanID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                   [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_loan].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]

Maybe you are looking for

  • My new iPod Touch 5g gets hung up when updating apps.

    The blue installation line freezes when complete and a duplicate app then appears. Solution?

  • Unable to view TIF files saved in pse7 on a Mac

    Hello! I burnt a few TIF files (downloaded as RAW files from camera via Lightroom 2.5, then converted to 8 bit TIF via pse7) onto CD. I was able to view the images on another pc but not on a Mac. Is there anything I can do? Maybe change settings on t

  • IOS 5 Contacts Call Bug

    I am using my iPhone 4 with IOS 5 in Mozambique. All my contacts are stored using each of my friend's/client's country code (I have got people from the US, Brazil, Italy...). Anyone who calls me and is in Mozambqiue (therefore using country code +258

  • Error in 'between' statement

    hi, I faced the following problem in sql query. SQL> SELECT B.NAME, C.FST_NAME, C.LAST_NAME FROM SIEBEL.S_PARTY_PER A, SIEBEL.S_ORG_EXT B, SIEBEL.S_CONTACT C WHERE (B.ROW_ID = A.PARTY_ID AND C.ROW_ID = A.PERSON_ID AND A.PERSON_ID IN (select D.NEW_VAL

  • Error reinstalling Photoshop CS 5.1 (already have MC 5.5 installed)

    I was having problems with Photoshop CS 5.1. I don't recall when they started, but I was unable to use any keyboard modifier keys (Ctrl, Alt, etc) for commands, and though I could click on items, dragging anything in photoshop would not work. I found