OLEDB query on Excel without headers: How do I specify Columns?

前端 未结 2 797
挽巷
挽巷 2021-01-16 14:42

I need to be able to handle Excel files versions 97 - 2010 and also those with and without header info.

Don\'t need help with connection strings : that works.

<
2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-16 15:09

    Refer to the columns as F1, F2, ... Fn, numbering from the first selected column.

    SELECT * FROM [Sheet1$G5:Z12]
    

    g5 = row 1, column F1.

    So:

    SELECT * FROM [Sheet1$G5:Z12]
    WHERE F2 = 'abc' AND F3 > #2011/01/31#
    

提交回复
热议问题