Excel Function : SQL.REQUEST

Download now!

Excel Function : SQL.REQUEST


Add-in and Automation


Connects with an external data source and runs a query from a worksheet, then returns the result as an array without the need for macro programming

Microsoft Excel Reference Page


Syntax and Description of the SQL.REQUEST Excel Function

I'm working on a VBA module in excel, and I want to use the SQL.REQUEST function to request a certain column from a certain table. I've got the connection string and everything set up, but I can't figure out how to format the SQL syntax to request a whole table. Range("A1").Value = SQL.REQUEST("Server=myServerAddress;Database=myDataBase;Trusted_Connection=true", "SELECT * FROM Table1;") A: Try this: Range("A1").Value = SQL.REQUEST("Server=myServerAddress;Database=myDataBase;Trusted_

About SQL.REQUEST Excel Function

The SQL.REQUEST function sends a request to a database and returns the results of the request as an array. The request can be a SQL query or a stored procedure. The function takes two arguments: the database connection string and the request string.