Question

I have a SQL query issue

  • 22 March 2022
  • 2 replies
  • 211 views

I have a SQL query to read the data from excel, and using the select query like below

SELECT DISTINCT [F1],SUM([F6]) FROM [Sheet1$A2:G] GROUP BY [F1]

but there is no data in sheet1 hence it is showing the error like 'This table contains cells that are outside the range of cells defined in the spreadsheet'. can anyone help me with this

 


2 replies

Userlevel 4
Badge +7

Hi @Shilpa N​ ,

 

I don't think passing in a range will do you much good.

Even if you are using SQL, it is limited to microsoft Access , and even more so when working with Excel.

 

Try passing the entire sheet name instead:

 

SELECT DISTINCT [F1],SUM([F6]) FROM [Sheet1$] GROUP BY [F1] ->If v11

 

SELECT DISTINCT [F1],SUM([F6]) FROM [Sheet1$$] GROUP BY [F1] -> If A360

 

Kind Regards,

Ashwin A.K

 

Thanks Ashwin,

 

let me try this solution.

 

 

Reply