Retrieve Specific Fields from Worksheet in External Excel Workbook

  • Hi,


    I need to retrieve fields "Preiod", "Arrears Rate" and "Refund Rate" from Sheet called "CRA Rates" in an external (closed) workbook.


    I have a data connection, which retrieves ALL fields from the above-mentioned location. However, I only need the 3 fields mentioned above.


    I tried modifying my Query by:
    1) Changing "COMMAND TYPE" to SQL, and
    2) Typing in the command: SELECT 'Period', 'Arrears Rate', 'Refund Rate' FROM 'CRA Rates$';


    Unfortunately, I got syntax errors, and so had to change the command type back to TABLE.


    Would appreciate any kind of help on this - i.e., Query-edit and/or VBA code


    (This used to be way easier/simpler in the good old days of Excel 2000.)


    Thanks,


    m

  • Re: Retrieve Specific Fields from Worksheet in External Excel Workbook


    Try:
    SELECT `Period`, `Arrears Rate`, `Refund Rate` FROM `CRA Rates$`;


    and make sure the type is set to SQL not table.

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!