Question

Hi, I would like to write a query to get the values < 365 from an excel table. The name of the column is "Days in Process". I am unable to give the where condition.

  • 7 February 2022
  • 13 replies
  • 15 views

Hi, I would like to write a query to get the values < 365 from an excel table. The name of the column is "Days in Process". I am unable to give the where condition.

13 replies

Userlevel 3
Badge +7

Could you please share the sample of the excel file header with 1 record value? I will try to create the query for this.

 

Userlevel 3
Badge +7

Select * from [sheetname$] where Days in Process <365

Userlevel 3
Badge +7

QuickTip: Connect to an Excel Spreadsheet As a Database

Userlevel 3
Badge +7

Please share the an error description here

Userlevel 3
Badge +7

Hi @Adityaganesh Srinivasan​ ,

 

Are you using excel as a database or directly fetching data from excel?

So, I have to loop the excel and then put it in a database, then use the query?

Userlevel 3
Badge +7

The query like a

 

Select [col1],[col2] from [sheetname$] where [col1] <365

 

 

Below is the excel file, I want to get the values for "days in Process" < 365

image

Userlevel 3
Badge +7

you can use if conditions with required column name <365.

 

 

yeah but that takes a lot of time since I have 10,000 rows. I connected the excel to the database and tried to fetch the data but its not working.

Userlevel 3
Badge +7

while fetching the data, the row values are stored in the record. so you can specify the By Name or Index

 

The index always starts with 0

For your cases, Days in Process - index number

 

For Example- Days in Process is the 1st column that should be 0

image

I wrote the query like SELECT * From [Table name$$] where Days in Process < 365. That threw an error

I am fetching data from excel

 

Reply