How to Get Filtered Data from SQL server into Microsoft Excel 2007

M

Manish

I want to import data from SQL server 2005 into Excel 2007 using
Data=>from other sources=>From SQL server. I am able to import
complete table (e.g. Item) but there are too many unnecessary fields
as well as records which also get imported. I want to filter the data
before importing into excel but don't know how to do that? For e.g. I
want to import "item" table with only the records whose item code
starts with FG and only "code" and "unit price" fields.

Can anybody help me out in this regard?

Manish
 
D

Donald Guillett

You could import and strip out what you dont want with text to columns
or a macro?
 
W

ward376

Once you reach the 'Import Data' dialog, click on 'Properties...' in
the lower left corner. (This is the dialog where you choose the type
of table to use and where to put the data.)

After clicking 'Properties', go to the tab named 'Definition' and you
can edit the SQL statement in the 'Command text:' box.

Maybe better:
Use Microsoft Query to connect to the server, the interface will help
to write an SQL statement for you. This is the bottom option when you
click the 'From Other Sources' button in the ribbon.

In MS Query, once you get to the 'Definition' tab of the 'Connection
Properties' dialog, the 'Edit Query' will not be disabled and you can
open the SQL-building interface from there.

Either way, with SQL you can pick and choose the data you want,
calculate fields, sort, use parameters, link tables etc.

Cliff Edwards
 
U

usmanahmad1226

This query will work
select code,unitprice from item
where code like 'fg%'

and u can write this query at
Other Data Sources
From SQL Query (at the end of the drop down list)
next
next
next
Query
and then write the query and go into file menu
and select export data into excel from there and then select pivot table from given options
 
S

sameer.ali

On Wednesday, August 7, 2013 3:05:03 PM UTC+5, (e-mail address removed) wrote:
I want to Filter data from Excel200 into SQL Server for a web detabase.

ho i can to do it?

Can anybody help me out in this regard?


SAMEER
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top