Need to output # of rows after date

This seems like it probably has a simple solution that I just
can't seem to get correct...
I need to output the next 4 events that take place from the
current date. I tried:
<cfloop from="1" to="4" index="i">
<cfif #DateFormat(games.gamedate)# GTE
#DateFormat(Now())#>
all the info that is displayed here
</cfif>
</cfloop>
However this is just returning all the games that take place
from the current date, and lists each game 4 times. I also tried
putting maxrows="4" in my <cfoutput> statement, but that
returns nothing.
Any and all help is much appreciated.

here's the entire block of code (minus the references to
getting the next 4 records...this works but just lists all games
from today on out):
<cfquery name="athgames" datasource="#dsn#"
username="#db_user#" password="#db_pass#" dbtype="query">
SELECT *
FROM Athletics
WHERE sport = 'Basketball'
ORDER BY gamedate ASC
</cfquery>
<cfset endofweek = dateAdd("d", +6, now())>
<cfoutput query="athgames" group="gamedate">
<cfif #DateFormat(athgames.gamedate)# GTE
#DateFormat(Now())#>
<cfif #DateFormat(athgames.gamedate)# EQ
#DateFormat(Now())#>
<p><u>Today's Games</u><br />
<cfelse>
<p><u>#DateFormat(athgames.gamedate, "dddd, mmmm
d")#</u><br />
</cfif>
<cfoutput>
  #athgames.homeaway#
#athgames.opponent# -
<cfif #TimeFormat(athgames.gametime, "h:mm")# EQ
#TimeFormat("12:59 AM", "h:mm")#>
TBA
<cfelse>
#TimeFormat(athgames.gametime,"h:mm tt")#<br />
</cfif>
</cfoutput>
</p>
</cfif>
</cfoutput>

Similar Messages

  • How do I update/insert into a target table, rows after date X

    Hi all
    I have a mapping from source table A to target table B. Identical table structure.
    Target table A updates rows and inserts rows daily. Every week I want to synchronize this with table B.
    I have CREATION_DATE and LAST_UPDATE_DATE on both tables. I want to pass in a parameter to this mapping of date X which tells the mapping:
    "if CREATION_DATE is past X then do an insert of this row in B, if LAST_UPDATE_DATE is past X then do an update of this row in B"
    Please can you help me work out how to map this correctly as I am new to OWB.
    Many thanks
    Adi

    Hi,
    You can achieve this by -
    1. Create a control table, say Control_Table, with structure
    Map Name, last_load_date. Populate this table with the mappings that synchronizes your Table B.
    2. Alter mapping, that loads Table B to use the above control table to get all the records from Table A, you have to join Table A and Control_Table with the condition -
    Control_Table.Map_Name = < mapping name>
    AND ( TableA.Creation_Date > Control_Table.last_load_date
    OR TableA.Last_Update_Date > Control_Table.last_load_date )
    3. Then use UPDATE/INSERT on the Table B based on the Keys. This should take care of INSERT ( if not present) / UPDATE (if the row already exists).
    4. Schedule the mapping to run on weekly basis.
    5. You have to maintain the Control_Table to keep changing the values for Last_Load_Date to pick the data since the last time Table B is synchronized.
    HTH
    Mahesh

  • Need to create a workflow after Date Modified is greater than 7 days

    I'm using SharePoint Deisnger 2010 and attempting to create a workflow to generate an email after the Date Modified is greater than 7 days. Checking to see if there is a way to create this workflow without creating a "calculated" field with a date.
    Have:
    If Current Item:Modified is greater than Today
    But would like to have 7 days not today or a set date.
    What's the best way to do this?

    Hello,
    In addition to Bistech, here is link to set date in WF context variable.
    http://stackoverflow.com/questions/17082455/sharepoint-designer-2010-set-variable-today-x-days
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Using a ommand to generate more than one row of data in utl file

    Hi Guys
    This might be a pretty long one. But I require help with regards to using outer and inner loops within my code.
    Here is the task:
    Each account involved with the DCA Allocation has an entry in the DCAACCOUNTALLOCATION table to track its progress. The STATUS value of the entry shows the position of the account in the DCA Allocation process.
    The status entry being tested is 3.
    Below is the code:
    create or replace
    PROCEDURE DCA_BMW_OUT
    IS
    -- Declare all variables as reference
    v_out_file UTL_FILE.FILE_TYPE;
    v_row_Count NUMBER;
    r_bmw NUMBER;
    v_out_directory all_directories.directory_path%type;
    v_out_filehandle UTL_FILE.FILE_TYPE := NULL;
    v_out_buffer varchar2 (32767);
    v_records NUMBER;
    body_output varchar2(32759 BYTE);
    dictionary_guarantorsexist varchar2 (1 Char);
    -- Text required within this part of the procedure
    v_body varchar2(32767 BYTE);
    v_header VARCHAR2(32759 BYTE);
    BEGIN
    FOR r_bmw IN
    ( SELECT *
    FROM dcaadditionaldata
    WHERE directory_name IS NOT NULL
    ) LOOP
    BEGIN
    -- Output file to be added into the directory specified
    v_out_file := utl_file.fopen (r_bmw.directory_name, 'DCAExport_1_' || TRIM(TO_CHAR(SYSDATE,'DDMMYYYY_HH24MISS')) || '.txt', 'W');
    -- The Header data which will be outputted to the file
    v_header := 'KennzeichenBrgschaftsforderungGesamtforderung|Währung|Übergabedatum|DifferenzierungAnwalts-oderInkassofall|MainMarktpartnernummer|
    MainAnrede|MainTitel|MainName|MainVorname|MainStraße|MainHausnummer|MainPLZ|MainOrt|MainLand|MainGeburtsdatum|MainTelefonnr.Schuldner|G1Marktpartnernummer
    G1Anrede      G1Titel      G1Name      G1Vorname      G1Straße      G1Hausnummer      G1PLZ      G1Ort      G1Land      G1Geburtsdatum      G1Telefonnr.Schuldner      G2Marktpartnernummer      G2Anrede      G2Titel
    G2Name|G2Vorname|G2Straße|G2Hausnummer|G2PLZ|G2Ort|G2Land|G2Geburtsdatum|G2Telefonnr.Schuldner|G3Marktpartnernummer|G3Anrede|G3Titel|G3Name|G3Vorname|
    G3Straße|G3Hausnummer|G3PLZ|G3Ort|G3Land|G3Geburtsdatum|G3Telefonnr.Schuldner|G4Marktpartnernummer|G4Anrede|G4Titel|G4Name|G4Vorname|G4Straße|G4Hausnummer|
    G4PLZ|G4Ort|G4Land|G4Geburtsdatum|G4Telefonnr Schuldner|G5Marktpartnernummer|G5Anrede|G5Titel|G5Name|G5Vorname|G5Straße|G5Hausnummer|G5PLZ|G5Ort|G5Land|
    G5Geburtsdatum|G5Telefonnr.Schuldner|Kundennr.|Bestandsnr.|Finanzierungsnr.|KennzeichenFinanzierung/Leasing|Kennzeichenprivat/gewerblich|
    reguläresVertragsende|Laufzeit|Vertragsdatum|Vertragsstatus|Ratenbetrag|Filiale/Gebiet|Finanzierungstyp|BankverbindungKonto|BankverbindungBLZ|
    RSVKennzeichen|Kündigungsdatum|Modell|Fahrgestellnummer|KFZKennzeichen|KFZZulassungsdatum|CoD1Marktpartnernummer|CoD1Anrede|CoD1Titel|CoD1Name|
    CoD1Vorname|CoD1Straße|CoD1Hausnummer|CoD1PLZ|CoD1Ort|CoD1Land|CoD1Geburtsdatum|CoD1Telefonnr.Schuldner|CoD2Marktpartnernummer|CoD2Anrede|CoD2Titel|
    CoD2Name|CoD2Vorname|CoD2Straße|CoD2Hausnummer|CoD2PLZ|CoD2Ort|CoD2Land|CoD2Geburtsdatum|CoD2Telefonnr.Schuldner|CoD3Marktpartnernummer|CoD3Anrede|
    CoD3Titel|CoD3Name|CoD3Vorname|CoD3Straße|CoD3Hausnummer|CoD3PLZ|CoD3Ort|CoD3Land|CoD3Geburtsdatum|CoD3Telefonnr.Schuldner|CoD4Marktpartnernummer|
    CoD4Anrede|CoD4Titel|CoD4Name|CoD4Vorname|CoD4Straße|CoD4Hausnummer|CoD4PLZ|CoD4Ort|CoD4Land|CoD4Geburtsdatum|CoD4Telefonnr.Schuldner|
    CoD5Marktpartnernummer|CoD5Anrede|CoD5Titel|CoD5Name|CoD5Vorname|CoD5Straße|CoD5Hausnummer|CoD5PLZ|CoD5Ort|CoD5Land|CoD5Geburtsdatum|
    CoD5Telefonnr.Schuldner Y|Y|5830,99|EUR|20/08/2009|DCA|4|123456|Herr||Mueller|Rainer|Messigasse|33|84432|Filz|Deutschland|01/07/1957|08912345|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||||||||||||||76543|5000234567||Lease|Privat|12/12/2013|60|12/12/2008||250,50|US|Rate|1234567890|32343450|N||BMW 320 i|W34567890PA34567|M-H-3456|09/12/2008||||||||||||||||||||||||
    N|450,80|EUR|20/08/2009|DCA|4|987654|Frau||Meier|Heide|Beinstr.|44|86353|Laus|Deutschland|03/06/1949|08987654|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||87654||8765675585|Loan|Gewerblich|14/03/2012|72|14/03/2006||500,01|DF|Select|976579657|32343450|N||BMW 500 sl|W94567890PA34568|M-H-3457|10/03/2006|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345
    Y|33970,50|EUR|20/08/2009|Lawyer|4|64646464|Frau||Schmidt|Susanne|Hueftgasse|55|89363|Maus|Deutschland|23/08/1933|08934567|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||98757|5000785675||Lease|Privat|11/11/2009|48|11/11/2005||380,70|GH|Zielrate|234567899|32343450|Y||BMW 380 s|W54567890PA34569|M-H-3458|07/11/2005||||||||||||||||||||||||
    N|10040,20|EUR|20/08/2009|Lawyer|4|4865465|Herr||Schulz|Karl|Nasenweg|77|83354|Schuh|Deutschland|18/01/1965|08972545|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||46789|50004765787||Lease|Privat|16/09/2012|60|16/09/2007||1234,56|OS|ZUS|98765432|32343450|Y||BMW 280 i|W74567890PA34570|M-H-3459|12/09/2007||||||||||||||||||||||||';
    utl_file.PUT_LINE(v_out_file,v_header,TRUE);
    -- Below will output a row of data which satisfy the requirements.
    FOR body_output IN
    ( SELECT
    AccountDetails.CUSTOMERNUMBER, AccountDetails.ACCOUNTNUMBER, CUSTOMERDETAILS.CDTITLE, CUSTOMERDETAILS.CDFIRSTNAME, CUSTOMERDETAILS.CDLASTNAME, AccountDetails.ACCOUNTTYPE,
    AccountDetails.ORIGINALCONTRACTENDDATE, AccountDetails.CONTRACTTERM, AccountDetails.CONTRACTENDDATE, AccountDetails.BRANCHAREA, AccountDetails.PRODUCTTYPE,
    AccountDetails.HOUSEBANKACCOUNT, AccountDetails.CARMODEL, AccountDetails.CARLICENCE, AccountDetails.ARREARSBALANCE, AccountDetails.CODEBTOR, AccountDetails.GUARANTORNUMBER
    FROM AccountDetails
    JOIN CUSTOMERDETAILS ON AccountDetails.CUSTOMERNUMBER = CUSTOMERDETAILS.CUSTOMERS1
    WHERE EXISTS
    ( SELECT *
    FROM Dcaaccountallocation
    JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
    WHERE Dcaaccountallocation.dcaid = 41
    AND Dcaaccountallocation.status = 3
    AND DebtEpisodes.DCASentDate IS NULL
    AND Dcaaccountallocation.ACCOUNTID = AccountDetails.ACCOUNTNUMBER
    AND DebtEpisodes.DCAORLAWYER = 'DCA'
    LOOP
    UTL_FILE.PUT_LINE (v_out_file,
    body_output.CUSTOMERNUMBER|| '|' || body_output.ACCOUNTNUMBER|| '|' ||body_output.CDTITLE|| '||' ||body_output.CDFIRSTNAME || '|||||' ||
    body_output.CDLASTNAME|| '||||' || body_output.ACCOUNTTYPE|| '|' ||body_output.ORIGINALCONTRACTENDDATE|| '||||' ||body_output.CONTRACTTERM || '|||||' ||
    body_output.CONTRACTENDDATE|| '|' || body_output.BRANCHAREA|| '||' ||body_output.PRODUCTTYPE|| '||' ||
    body_output.HOUSEBANKACCOUNT|| '|||' || body_output.CARMODEL|| '||||' ||body_output.CARLICENCE|| '|' ||
    body_output.ARREARSBALANCE|| '||||' || body_output.CODEBTOR|| '|' ||body_output.GUARANTORnumber);
    END LOOP;
    UTL_FILE.fclose (v_out_file);
    EXCEPTION
    WHEN OTHERS THEN
    UTL_FILE.put_line (v_out_file, 'failed');
    -- If any errors occur when closing the file, then we close the opened file.
    IF utl_file.is_open(v_out_file) THEN
    UTL_FILE.fclose (v_out_file);
    END IF;
    END;
    UPDATE DebtEpisodes
    SET handoverdate = null
    WHERE DCAORLAWYER = 'DCA'
    AND accountid IN
    ( SELECT accountid
    FROM Dcaaccountallocation
    WHERE Dcaaccountallocation.status = 3
    AND Dcaaccountallocation.dcaid = 41
    END LOOP;
    END DCA_BMW_OUT;
    Currently, the above codes issue is that although many rows of data have been inputted in all the tables, with regards to the select criteria above (in italics), it only produces one row of data when i expect more than one to appear.
    If the query only outputs one row but you're expecting it to produce more than one row, then you need to dissect the statement to find out where the output is being unduly restricted
    I was told maybe an outerloop or an inner loop would do the trick, but really stuck on how and where to put it.
    Hope this makes sense guys and I would really appreciate your time.
    Thanks

    if i run this particular code
    ( SELECT
    AccountDetails.CUSTOMERNUMBER, AccountDetails.ACCOUNTNUMBER, CUSTOMERDETAILS.CDTITLE, CUSTOMERDETAILS.CDFIRSTNAME, CUSTOMERDETAILS.CDLASTNAME, AccountDetails.ACCOUNTTYPE,
    AccountDetails.ORIGINALCONTRACTENDDATE, AccountDetails.CONTRACTTERM, AccountDetails.CONTRACTENDDATE, AccountDetails.BRANCHAREA, AccountDetails.PRODUCTTYPE,
    AccountDetails.HOUSEBANKACCOUNT, AccountDetails.CARMODEL, AccountDetails.CARLICENCE, AccountDetails.ARREARSBALANCE, AccountDetails.CODEBTOR, AccountDetails.GUARANTORNUMBER
    FROM AccountDetails
    JOIN CUSTOMERDETAILS ON AccountDetails.CUSTOMERNUMBER = CUSTOMERDETAILS.CUSTOMERS1
    WHERE EXISTS
    ( SELECT *
    FROM Dcaaccountallocation
    JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
    WHERE Dcaaccountallocation.dcaid = 41
    AND Dcaaccountallocation.status = 2
    AND DebtEpisodes.DCASentDate IS NULL
    AND Dcaaccountallocation.ACCOUNTID = AccountDetails.ACCOUNTNUMBER
    AND DebtEpisodes.DCAORLAWYER = 'DCA'
    This returns 1 row of data
    However if i run a small part of the above code...
    SELECT *
    FROM Dcaaccountallocation
    JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
    WHERE Dcaaccountallocation.dcaid = 41
    AND Dcaaccountallocation.status = 2
    It returns a lot of rows with a status of 2
    Now i presume what I am going to do is to ensure that all the fields provide satisfactory requirements, with regards to the above code. Although I have many records in all the stated tables already.
    :(

  • Retrieve 3 rows of data and put each row in different position on screen

    I need to retrieve 3 consecutive rows of data (easy) and need to put each row's data in an entirely different location on the home page
    for example,
    row 1 needs to go up in the top left content box
    row 2 needs to go in the large content area in the middle of the page
    row 3 needs to be put down in the footer of the page
    what's the most efficient way to do this ?

    Ok, I've tried to research this a bit more, but I'm no further forward
    So if I have a query...
    <cfquery name="getData" datasource="foo">
      SELECT *
      FROM 00_pricelist
    </cfquery>
    <cfoutput query="GetData" startrow=1 maxrows=3 >
         <!--- surrounding table 1 --->
         #getData.uneak_code[1]#<br />
         <!--- surrounding table 2 --->
         #getData.uneak_code[2]#<br />
         <!--- surrounding table 3 --->
         #getData.uneak_code[3]#<br />
    </cfoutput>
    can you tell me what I'm doing wrong ?

  • VO filter rows by date

    Hi,
    I need to filter the row by date, so I have this
    DCBindingContainer dcbindings = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterator = dcbindings.finIteratorBinding("MyVO1Iterator");
    RowSetIterator rsi = iterator.getRowSetIterator();
    Row [] filteredRows = rsi.getFilteredRows("Date", sampleDay.toString());The problem is sampleDay.toString() and the VO's field Date have this date format "2013-03-06 00:00:00.0", so it isn't
    filtering by date but also by hour, minute and second.
    I would format sampleDay but I can't not format the field Date. Do you know any other way to achieve this?
    Thanks in advance,
    DV

    Check out Franks article http://www.oracle.com/technetwork/developer-tools/adf/learnmore/59-table-filter-by-data-range-176653.pdf and http://www.oracle.com/technetwork/developer-tools/adf/learnmore/30-table-filter-queries-169172.pdf
    I wonder why you see the time part. Is the data type of the "Date" attribuite date or timestamp?
    Timo

  • Need badi which triggers immediately after saving the vendor master data

    Hi all.
        I need a badi which triggers after vendor master (xk02) is changed . The badi should trigger after the data base commit ( i.e after all the changes have been stored in data base tables). Pls let me know
    Thans in advance.

    try these:
    EXIT_SAPLV45T_001       V45T0001     Customer exits text determination
    EXIT_SAPMF02D_001     SAPMF02D     User exits: Customer master data
    EXIT_SAPMF02K_001     SAPMF02K     User exits: Vendor master data
    EXIT_SAPMV45A_002     V45A0002     Predefine sold-to party in sales document
    EXIT_SAPMV45A_003     V45A0003     Collector for customer function modulpool MV45A
    EXIT_SAPMV45A_004     V45A0003     Collector for customer function modulpool MV45A
    BADI's:
    CUSTOMER_ADD_DATA     CUSTOMER_ADD_DATA     Additional Data at Customers
    CUSTOMER_ADD_DATA_CS     CUSTOMER_ADD_DATA_CS     Additional Data at Customers (Subscreen Container 4000)
    VENDOR_ADD_DATA     VENDOR_ADD_DATA     Additional Vendor Data
    VENDOR_ADD_DATA_CS     VENDOR_ADD_DATA_CS     Additional Data for Vendors (Subscreen 4000)

  • Need more than 5 rows in bridge-output-webgallery-HTML gallery

    Hello,
    I need more than 5 rows in bridge-output-webgallery-HTML gallery for my website. 10-20 rows would be perfect in my opinion.
    all help will be highly appreciated
    Rune Hammerstad
    http://exterill.com

    You could request a change here...
    http://feedback.photoshop.com/photoshop_family/topics
    If enough people support your request it might get changed, worth a try.

  • I NEED A FIRST 5 ROWS DATA

    HI EXPORTS,
    MY QURY IS
    SELECT TOT.HTNO, TOT.RESULT_NAME, TOT.TOTALMARKS, TOT.TOTALRANK,
    TOT.RESEXAMSLNO, TOT.RESACADEMICSLNO, TOT.RESGROUPSLNO,
    TOT.RESCORPCOLLSLNO, TOT.DISTRICTSLNO
    FROM RESULT_STUDENTMARKS_TOTALS TOT
    WHERE TOT.RESEXAMSLNO = 1
    AND TOT.RESGROUPSLNO = 1
    AND TOT.RESACADEMICSLNO = 9
    AND TOT.RESCORPCOLLSLNO IN (99)
    AND TOT.DISTRICTSLNO IN (4)
    AND ROWNUM <5
    ORDER BY TOT.HTNO
    I WANT FIRST 4 ROWS OF DATA BASED ON ASSENDING ORDER CAN U CHAGE IS QURY OR
    GIVEN ANY EXAMPLE OF FIRST 4 ROWS OF DATA ORDER BY ONLY ONE FIELD IN THAT TABLE
    THANX & REGARDS
    ASHOK
    Edited by: Ashok on Apr 28, 2011 11:01 PM

    See
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:62364503028143
    and
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:2853107469873
    You have to filter the ROWNUM after the ORDER BY.
    so :
    select * from
    SELECT TOT.HTNO, TOT.RESULT_NAME, TOT.TOTALMARKS, TOT.TOTALRANK,
    TOT.RESEXAMSLNO, TOT.RESACADEMICSLNO, TOT.RESGROUPSLNO,
    TOT.RESCORPCOLLSLNO, TOT.DISTRICTSLNO
    FROM RESULT_STUDENTMARKS_TOTALS TOT
    WHERE TOT.RESEXAMSLNO = 1
    AND TOT.RESGROUPSLNO = 1
    AND TOT.RESACADEMICSLNO = 9
    AND TOT.RESCORPCOLLSLNO IN (99)
    AND TOT.DISTRICTSLNO IN (4)
    ORDER BY TOT.HTNO
    where rownum < 6
    order by 1Hemant K Chitale
    Edited by: Hemant K Chitale on Apr 29, 2011 2:28 PM
    Changed "rownum < 5" to "rownum < 6" to get 5 rows.

  • 2008 Mac Pro 10.5.8 shuts down after hours of no use, Set to never shut down. Can be resumed pressing any key but all programs not in startup list need to be restarted and unsaved data lost .   New behavior.  No system changes.

    2008 Mac Pro 10.5.8 shuts down after hours of no use, Set to never shut down. Can be resumed pressing any key but all programs not in startup list need to be restarted and unsaved data lost .   New behavior.  No system changes.

    2008 Mac Pro 10.5.8 shuts down after hours of no use, Set to never shut down. Can be resumed pressing any key but all programs not in startup list need to be restarted and unsaved data lost .   New behavior.  No system changes.

  • Help writing a excel macro to do a copy of 4 cells and paste transpose. I need to loop the copy and paste through 6900 rows of data.

      I need help writing a excelmacro to do a copy of 4 cells and paste transpose.  I need to loop the copy and paste through 6900 rows of data.  I started the macro with two rounds of copying & paster transposed but I need help getting it
    to loop through all rows.  Here is what macro looks like now.
        Range("I2:I5").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("J2").Select
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=True
        Range("I6:I9").Select
        Application.CutCopyMode = False
        Selection.Copy
        Range("J6").Select
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=True
    End Sub

    Thanks Jim for the solution above.
    Hi Brogents,
    Thanks for posting in our forum. Please note that this forum focuses on questions and feedback for Microsoft Office client. For any
    VBA/Macro related issues, I would suggest you to post in the forum of
    Excel for Developers, where you can get more experienced responses:
    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=exceldev
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Add a row after Total row in ALV report

    Hi Experts,
    I have a report is displayed by  ALV format(not use function module to display it but use Class cl_gui_custom_container),I want to add a row after the total row. for example,
    Customer   amount1    amount2    amount3 
    10000         1,234        1,000         2,000
    10001         4,000        2,000         1,000
    10002         1,300        1,000         3,000
    11000         1,200        4,000         3,000
         Total:     7,734        8,000         9,000
    Ratio%        31.27       32.34          36.39
    the row of 'Total' is calculated by fieldcat-do_sum = 'X' But after the Total row we need a Ratio row to display the ratio. Yes we can calculate the total amout and ratio and then append it into the output itab, but we don't like this solution.We want to keep the total function in the ALV report.Any experts can poit me a direction. Thanks in advance.
    Joe

    Djoe,
    First you need to handle the user command,in order to capture the button action. For this you need to implment a class, i  am attaching sample codes here
    In top include write the following code
    CLASS lcl_event_handler DEFINITION .
      PUBLIC SECTION .
        METHODS:
         handle_toolbar  FOR EVENT toolbar                   " To add new functional buttons to the ALV toolbar
                         OF        cl_gui_alv_grid
                         IMPORTING e_object,
         handle_user_command FOR EVENT user_command          " To implement user commands
                            OF cl_gui_alv_grid
                            IMPORTING e_ucomm .
      PRIVATE SECTION.
    ENDCLASS.                                               " Lcl_event_handler DEFINITION
    Now   <b>Class implementation</b>
    CLASS lcl_event_handler IMPLEMENTATION .
      METHOD handle_toolbar.                                " Handle Toolbar
        PERFORM f9500_handle_toolbar USING e_object.
    ENDMETHOD .                                            " Handle_toolbar
      METHOD handle_user_command .                          " Handle User Command
        PERFORM f9600_handle_user_command USING e_ucomm .
      ENDMETHOD.
    ENDCLASS .                                              " lcl_event_handler IMPLEMENTATION
    FORM f9600_handle_user_command USING p_e_ucomm TYPE sy-ucomm.
      CONSTANTS:c_newl(4) TYPE c
                          VALUE 'NEWL',               " New line
                c_copy(4) TYPE c
                          VALUE 'COPY',               " Copy
                c_corr(4) TYPE c
                          VALUE 'CORR'.               " Correction
      CASE p_e_ucomm .
        WHEN c_newl.
    Create a new line
          PERFORM f9610_insert_new_line.
    ENDFORM.                                          " f9600_handle_user_command
    FORM f9610_insert_new_line .
    *Data Declarations
      DATA: lt_rows     TYPE lvc_t_row,                 " Itab for row property
            ls_rows     TYPE lvc_s_row,                 " Work area for row
            lv_cntid    TYPE i.                         " Counter
      DATA: gv_index TYPE sy-index.
      CLEAR gs_last.
      CALL METHOD gr_alvgrid->get_selected_rows
        IMPORTING
          et_index_rows = lt_rows.
      READ TABLE lt_rows INTO ls_rows INDEX 1.
      IF sy-subrc EQ 0.
        gv_index = ls_rows-index + 1.
      ELSE.
        gv_index = 1.
      ENDIF.
      DESCRIBE TABLE gt_last LINES lv_cntid.
      lv_cntid = lv_cntid + 1.
      gs_last-cntid = lv_cntid.
      INSERT gs_last INTO gt_last INDEX gv_index.
      LOOP AT gt_last INTO gs_last FROM gv_index TO gv_index.
    Make the new line editable
        PERFORM f9611_style.
      ENDLOOP.
      CALL METHOD gr_alvgrid->refresh_table_display
        EXCEPTIONS
          finished = 1
          OTHERS   = 2.
    ENDFORM.                    " f9610_insert_new_line
    You can ask questions doubts if any!
    regards
    Antony Thomas

  • Problem to calculate the coherence (using NetworkFunction-VI) with only 1 row of data for each, the stimulus and response input

    Hello,
    I am trying to calculate the coherence of a stimulus and response
    signal using the Network Functions (avg) VI's. The problem is that I
    always get a coherence of "1" at all frequencies. This problem is
    already known (see KnowledgeBase document: Why is the Network Functions (avg) VI's Coherence Function Output "1"?).
    My trouble is that the described solution (-> the stimulus and response input matrices need to have at least two rows to get non-unity coherence values) doesn't help me much, because I only have one array of stimulus data and one array of response values.
    Thus, how can I fullfil the 'coherence-criteria' to input at least two rows of data each when I just have one row of data each?
    Any hint or idea is very much appreciated. Thanks!
    Horst

    With this weird board layout, I'm not sure whether you were asking me, but, on the assumption that you were, here goes:
    I found no need to use the cross-power spectrum and power spectrum blocks
    1... I was looking for speed.
    2... I already had the component spectral data there, for other purposes. From that, it's nothing but addition and multiplication.
    3... The "easy" VIs, assume a time wave input, as I recall. Which means they would take the same spectrum of the same timewave several times, where I only do it once.
    I have attached PNGs of my code.
    The PROCESS CHANNEL vi accepts the time wave and:
    1... Removes DC value.
    2... Integrates (optional, used for certain sensors).
    3... Windows (Hanning, etc. - optional)
    4... Finds spectrum.
    5... Removes spectral mirrors.
    6... Scales into Eng. units.
    7... From there, you COULD use COMPLEX-TO-POLAR, but I don't care about the phase data, and I need the MAG^2 data anyway, so I rolled my own COMPLEX-TO-MAG code.
    The above is done on each channel. The PROCESS DATA vi calls the above with data for each channel. The 1st channel in the list is required to be the reference (stimulus) channel.
    After looping over each channel, we have the Sxx, Syy, and Sxy terms. This code contains some averaging and peak-picking stuff that's not relevant.
    From there, it's straightforward to ger XFER = Sxy/Sxx and COHERENCE = |Sxy|^2 / (Sxx * Syy)
    Note that it uses the MAGNITUDE SQUARED of Sxy. Again, if you use the "easy" stuff, it will do a square-root operation that you just have to reverse - it is obtained faster by the sum of the squares of the real and imag parts.
    Hope this helps.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks
    Attachments:
    ProcessChannel.png ‏25 KB

  • Merge 2 rows into single row with data update?

    hello all,
    i have a table with below data,
    declare @tbl table (uid int, uname varchar(10), start_dt date, end_dt date)
    insert into @tbl values (1, 'env1', '4/4/2010', '5/5/2012')
    insert into @tbl values (2, 'env2', '5/4/2010', '6/6/2012')
    --earlier start data is '4/4/2010' from 'env1'
    --latest end data is '6/6/2012' from 'env2'
    insert into @tbl values (3, 'env1', '3/3/2010', '4/4/2012')
    insert into @tbl values (4, 'env2', '2/2/2010', '5/5/2012')
    --earlier start data is '2/2/2010' from 'env2'
    --latest end data is '5/5/2012' from 'env2'
    insert into @tbl values (5, 'env1', '8/8/2010', '12/12/2012')
    insert into @tbl values (6, 'env2', '9/9/2010', '10/10/2012')
    --earlier start data is '8/8/2010' from 'env1'
    --latest end data is '12/12/2012' from 'env1'insert into @tbl values (6, 'envX', '9/9/2010', '10/10/2012')insert into @tbl values (6, 'envY', '9/9/2010', '10/10/2012')
    i need to merge 2 rows for column  "uname" having value "env1" & "env2" to "envZ" and need to capture earlier start date and latest end date from both and update with new.
    the desire output should be,
    declare @tbl table (uid int, uname varchar(10), start_dt date, end_dt date)
    insert into @tbl values (1, 'envZ', '4/4/2010', '6/6/2012')
    insert into @tbl values (4, 'envZ', '2/2/2010', '5/5/2012')
    insert into @tbl values (5, 'envZ', '8/8/2010', '12/12/2012')
    insert into @tbl values (6, 'envX', '9/9/2010', '10/10/2012')
    insert into @tbl values (6, 'envY', '9/9/2010', '10/10/2012')
    note - i must need to update one row and delete other row as i can't insert new rows (having huge data with other columns also).
    please suggest optimize query. thanks!

    Which version and edition of SQL Server are you using?
    Whenever there is a row with 'env1', there is a corresponding 'env2' and vice versa? 
    The row with 'env2' is always after the row with 'env1'?   (uid+1)
    If the answers are yes to both questions above, here's a possibility:
    -- code #1 v3
    ;with
    ENVZ as (
    SELECT uid= case when T1.start_dt <= T2.start_dt then T1.uid else T2.uid end,
    start_dt= case when T1.start_dt <= T2.start_dt then T1.start_dt else T2.start_dt end,
    end_dt= case when T1.end_dt > T2.end_dt then T1.end_dt else T2.end_dt end
    from @tbl as T1
    inner join @tbl as T2 on T2.uid=T1.uid+1 and T2.uname='env2'
    where T1.uname = 'env1'
    MERGE
    into @tbl as T3
    using ENVZ as T4
    on T3.uid = T4.uid
    when matched and (T3.uname in ('env1','env2')) then
    UPDATE set T3.uname= 'envZ',
    T3.start_dt= T4.start_dt,
    T3.end_dt= T4.end_dt
    when not matched by source and (T3.uname in ('env1','env2')) then
    DELETE;
    The table @tbl is read three times in the above code. There are probably ways to optimize the above code. Or even other more efficient approach.
    José Diz     Belo Horizonte, MG - Brasil

  • Need to get the row selected in table control without ay action

    Dear Team,
    I have a requirement in which I need to pass the row selected of a table control to a variable.
    Here I need to get the row selected with out any other action
    then the action of selection of a row.
    Is it possible to read table control values using FM DYNP_VALUES_READ.
    thanks in advance,
    regards,
    Sai

    HI,
    Sai Kumar Potluri
    I tried in IDES it working.
    Here is the code.
    REPORT  ZPRA_TC_D.
    TABLES : SCARR.
    CONTROLS TC TYPE TABLEVIEW USING SCREEN 1.
    DATA : SELLINE TYPE I,
           SELINDEX TYPE I.
    DATA : ACT LIKE SCARR-CARRID,
           ANT LIKE SCARR-CARRNAME.
    DATA : ITAB LIKE SCARR OCCURS 0 WITH HEADER LINE.
    CALL SCREEN 1.
    *&      Module  STATUS_0001  OUTPUT
    *       text
    MODULE STATUS_0001 OUTPUT.
      SET PF-STATUS 'ME'.
    *  SET TITLEBAR 'xxx'.
    SELECT * FROM SCARR INTO TABLE ITAB.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  MOV  OUTPUT
    *       text
    MODULE MOV OUTPUT.
      MOVE-CORRESPONDING ITAB TO SCARR.
    ENDMODULE.                 " MOV  OUTPUT
    *&      Module  USER_COMMAND_0001  INPUT
    *       text
    MODULE USER_COMMAND_0001 INPUT.
    CASE SY-UCOMM.
    WHEN 'BACK' OR 'UP' OR 'EXIT'.
      LEAVE PROGRAM.
    WHEN 'SEL'.
      GET CURSOR FIELD SCARR-CARRID LINE SELLINE.
      SELINDEX = TC-TOP_LINE + SELLINE - 1.
      READ TABLE ITAB INDEX SELINDEX.
      ACT = ITAB-CARRID.
      ANT = ITAB-CARRNAME.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0001  INPUT
    In Flow Logic.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0001.
    LOOP AT ITAB WITH CONTROL TC.
      MODULE MOV.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT ITAB.
    ENDLOOP.
    MODULE USER_COMMAND_0001.

Maybe you are looking for