Is this possible?....

  • Thread starter Thread starter Dan B
  • Start date Start date
D

Dan B

Greetings...

I have a SQL database I want to pull data from.
The data is company contact information and dollar amounts of insurance
premium.
I want to have the data automatically go into different worksheets based on
the premium amount.

For example, Sheet 1 would be all data, sheet 2 would be premiums under
$10,000, sheet 3 would be premiums from $10,001 to $50,000 and so on.

Can that be done, and where would be a good place to start figuring out how
to do it?

Thanks,
Dan
 
At least with Access databases, you can go to data>import external data>new
database query and then once you decide what fields to import, you can also
filter records by contents of any field, such as >10000

With this method you'd have to create a new query range on each worksheet,
and only import data that fits what you want on the worksheet.
 
What about pulling all information then splitting it onto different sheets
using advanced filtering?

Lynn
 
To import data, you can use the External Data feature of excel.

1. Import all data:
- in sheet 1, goto menu Data > Import (or Get) External Data > New Database
Query... the Data Source dialog pops up
- choose the data source by selecting the databse directly or the database
type (eg: MS Access Database)
- locate the database if not done yet
- create the query or select the table / fileds to import
- ...
The data are automaticallly imported to excel
To refresh the query/data at later time, right click the resulting data and
choose the Refresh submenu.

2. To import data within a range of premium, do the same as above in
another sheet, and set the $ limits on the corressponding filed (eg: field
Premium).

Regards,
Sebastien
 
A little more complicated but a betterway to do this would be as follows:
1. Use ADO (or ODBC if you prefer) to connect to the database.
2. Submit a Query such as "Select * from Premium_table where premium<10000
3. Copy this data into sheet1.

You would then repeat this exercise by changing the premium amount in the
where clause so records with a premium between 10000 and 50000 are selected
and then entered into the worksheet.

If ADO, SQL, and VBA are not very familiar to you, try the other suggestions
first. If they are, this is the way to go.
 

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

Back
Top