1 Replies - 1280 Views - Last Post: 01 June 2011 - 11:52 PM Rate Topic: -----

#1 Damage  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 27
  • View blog
  • Posts: 1,079
  • Joined: 05-June 08

Dataset from Excel using SQL query

Posted 01 June 2011 - 09:08 PM

Hi

Not sure if this is the right place for this. what i'm doing is getting a dataset from an excel spread using a simple sql query.
What i want to do in the where clause is avoid selecting the first few rows but i haven't had any success

So far it's just

select [F2] ,[F3],[F4]  from [Current$] where ID is Null



what i would like to do is remove the where id is null clause and use some thing like
where [rowindex] > 0



but that doesn't work.

This post has been edited by Damage: 01 June 2011 - 09:09 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Dataset from Excel using SQL query

#2 June7  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 104
  • View blog
  • Posts: 904
  • Joined: 09-December 08

Re: Dataset from Excel using SQL query

Posted 01 June 2011 - 11:52 PM

You can use a named range reference or row/column notation.

strQuery = "SELECT * FROM MyRange"

strQuery = "SELECT * FROM [Sheet1$A3:B10]"

See: http://support.microsoft.com/kb/257819
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1