Skip to main content
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.

  • Feb 7, 2022 7:18 PM UTC
  • 13 replies
  • 173 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

Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+7
  • Most Valuable Pathfinder
  • Feb 7, 2022 9:02 PM UTC

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

 


Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+7
  • Most Valuable Pathfinder
  • Feb 7, 2022 9:06 PM UTC

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


Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+7
  • Most Valuable Pathfinder
  • Feb 7, 2022 9:17 PM UTC

Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+7
  • Most Valuable Pathfinder
  • Feb 7, 2022 9:24 PM UTC

Please share the an error description here


Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+7
  • Most Valuable Pathfinder
  • Feb 7, 2022 9:30 PM UTC

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?


Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+7
  • Most Valuable Pathfinder
  • Feb 7, 2022 9:40 PM UTC

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


Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+7
  • Most Valuable Pathfinder
  • Feb 7, 2022 9:48 PM UTC

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.


Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+7
  • Most Valuable Pathfinder
  • Feb 7, 2022 9:56 PM UTC

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