Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL data access help required?
I've never used excel to do this before (see below), so
i'm at a complete loss abnd could use some guidance. What i've done so far.... I need to connect to an sql db and retrieve some information that populates my excel spreadsheet. In excel (2000), i've gone to "Data/get external data/New database query", i've connected to my sql server using the SQL ODBC driver, ok..this bits fine. I then create an excel query that runs some T-SQL, ok, this bits fine. e.g. DECLARE @month varchar(15) SET @month = datename(month,dateadd (mm,-1,getdate())) DECLARE @year varchar (5) SET @year = datename(year,getdate()) select count(*) from <Table where <field=@month and <field=@year if i run the query (using microsoft query) it gives me the correct values, but in my cell within excel it shoes me nothing but the name of the excel query that is running and no values? I seem to be missing something here, can anyone point me in the right direction? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Required data entry | Excel Discussion (Misc queries) | |||
Required data in one sheet | Excel Worksheet Functions | |||
Can Excel access data from Access?! | Excel Discussion (Misc queries) | |||
Data manipulation help required ! | Excel Worksheet Functions | |||
Set an Access field "not" required w/ADO | Excel Programming |