Friday, March 30, 2012

Linking Excel and SQL

I would like to link an Excel Spreadsheet to my SQL 2K Database. Where do I
need to start?
For example. I would like to have a cell in Excel that gives me the sum of
Sales Orders in my SQL Database. I would also like for this to be able to
change according to a date field in excel that can be set.
Thanks for any help.So far I have tried using Microsoft Query, and I have entered my Select
statement. Here's another question though,
How do have a select statement that changes according to what is in a cell
in Excel. For Example:
Select <field> from <table> where <field>=<Cell in Excel>
"Preacher Man" <nospam> wrote in message
news:elnkSnDIGHA.3944@.tk2msftngp13.phx.gbl...
>I would like to link an Excel Spreadsheet to my SQL 2K Database. Where do
>I need to start?
> For example. I would like to have a cell in Excel that gives me the sum
> of Sales Orders in my SQL Database. I would also like for this to be able
> to change according to a date field in excel that can be set.
> Thanks for any help.
>|||Hi
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\External\MyExcel.xls";
User ID=Admin;Password=;Extended properties=Excel 8.0')...Book1$
"Preacher Man" <nospam> wrote in message
news:elnkSnDIGHA.3944@.tk2msftngp13.phx.gbl...
>I would like to link an Excel Spreadsheet to my SQL 2K Database. Where do
>I need to start?
> For example. I would like to have a cell in Excel that gives me the sum
> of Sales Orders in my SQL Database. I would also like for this to be able
> to change according to a date field in excel that can be set.
> Thanks for any help.
>|||make sure you understand that you're going to be using paths from the SQL
Server; not from your desktop right?
so 9 times out of 10; you would want to use a UNC path?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uOWl7WOIGHA.1836@.TK2MSFTNGP11.phx.gbl...
> Hi
> SELECT *
> FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source="c:\External\MyExcel.xls";
> User ID=Admin;Password=;Extended properties=Excel 8.0')...Book1$
>
>
> "Preacher Man" <nospam> wrote in message
> news:elnkSnDIGHA.3944@.tk2msftngp13.phx.gbl...
> >I would like to link an Excel Spreadsheet to my SQL 2K Database. Where
do
> >I need to start?
> >
> > For example. I would like to have a cell in Excel that gives me the sum
> > of Sales Orders in my SQL Database. I would also like for this to be
able
> > to change according to a date field in excel that can be set.
> >
> > Thanks for any help.
> >
>sql

No comments:

Post a Comment