If you have MS Excel, then you can return data from a database (such as SQL Server) via the menu... Data, Import External Data, New Database Query.
This will then prompt you to select a "Data Source" ... if you don't already have an ODBC data source, then you will need to create one (usually accessible from your Control Panel; look under Administrative Tools and you should find a Data Sources (ODBC) icon).
Once you've configured your Data Source Name, you can then use MS Query to pull the info from your SQL database ...
MS Query offers a simple GUI and a "helpful" wizard. The GUI lets you drag and drop tables and fields into your query, but it isn't the easiest tool to use if you write your own SQL code (as the query text box is 50 chars x 10 lines) and MS Query prefers to create its SQL code by using the older ANSI89 (?) join syntax of putting the join in the WHERE clause...
Code:
Select table1.col_a,
, table1.col_b
, table2.col_1
, table2.col_2
from table1
, table2
where table1.col_a = table2.col_1
whereas the more recent ANSI92 syntax puts the join in the FROM clause...
Code:
Select table1.col_a,
, table1.col_b
, table2.col_1
, table2.col_2
from table1
inner
join table2
on table1.col_a = table2.col_1
So, if you try to use the latter syntax in your code, or if using more than one left outer join in a query, or correlated subqueries, or queries using derived tables ... MSQuery "disapproves" of and it does so by withdrawing the GUI, withdrawing the facility of parameters in your code and reverting to providing only the very small SQL code box.
All this said, it will still run your code - good luck on debugging it in MS Query (believe me, I've had some fun with this monkey recently).
Mark, somewhere near Blackburn Lancs!