Using excel as db

Hi All, I’m using excel as database and my excel looks like this, where header is in A6. If I write query like this it gives error

Select * from [Query$] where [PEACCM] =12 and [PEACCD]=31

Reason for using Excel as db - is this excel (.xlsm) contains more than 50k records and while reading the excel process scope it is taking more than 6-10 mins read

Hi @ch460960

Try this:

SELECT * FROM [SheetName$A6:Z] WHERE [PEACCM] = 12 AND [PEACCD] = 31

=> Replace [SheetName] with the name of your worksheet.
=> A6:Z specifies the range of cells to query. Adjust the range according to your data.
=> PEACCM and PEACCD are assumed to be column headers. Make sure they match the actual column headers in your Excel file.
=> The condition WHERE [PEACCM] = 12 AND [PEACCD] = 31 filters the rows based on the values in columns PEACCM and PEACCD.

Hope it helps!!

@ch460960

Select * from [Query$A6:Z] where [PEACCM] = 12 and [PEACCD] = 31

@mkankatala this is error I’m getting. If I Run only Select * from [Query$] it’s working

Hi @ch460960

Check the below thread

Or try this:

SELECT * FROM [Query$A6:Z100000] WHERE [PEACCM] = 12 AND [PEACCD] = 31

Hope it helps!!

1 Like

Thank you so much :slight_smile:

1 Like

It’s my pleasure @ch460960

Happy Automation!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.