Good Afternoon, Everyone! I'm trying to put together a workbook that queries a SQL server and have been successful in using the original vb code, but when I try to include a 'WHERE' in the SQL statement, it doesn't work. Here is what I have that works and returns all records. I have tried multiple ways of putting a 'WHERE' clause after 'FROM table' with all of them failing. What I'm trying to accomplish is, in Sheet1 of my workbook, I have Cell B4 that I would like the SQL statement to reference; (i.e. return records 'WHERE name = B4). I greatly appreciate anyone and everyone's help!
This code, immediately below, works to return all records from the table.
I've tried, to no avail:
Bookmarks