Home

How to use custom SQL select statement in excel

Kwethemba
Occasional Visitor

 

Hi everyone, I have an Excel workbook in which i have 3 queries that I have imported using the "Get data from Table/Table" function. I need to use a select statement to retrieve certain information from the 3 different tables in the workbook using joins in the select statement. Please see below SQL,

 

"SELECT top 10000 [T.PrImaryIP], [PT.KB] , [PT.CVE], [PT.Date], [T.ComputerName], [S.Status]

from [Template$] AS [T], [Servers List$] AS [S]

left outer join [Patch Data$] as [PT] on PT.KB = T.KBID and

left outer join [Servers List$] AS [S] on S.IPAddress = T.PrimaryIP"

 

My problem is that I do not know where to place the query, I tried using the Advenced Editor but it does not bring back the results. Can anyone please help

1 Reply

You may embed SQL query only within connection to SQL database. If you query the tables from the Excel sheet use Merge Queries, Filter, etc in Power Query Editor menu (and/or M-Script code if you are familiar with it).

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
16 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
11 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies