ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Is this possible?.... (https://www.excelbanter.com/excel-worksheet-functions/7311-possible.html)

Dan B

Is this possible?....
 
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



Dave R.

At least with Access databases, you can go to dataimport external datanew
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.



"Dan B" wrote in message
...
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





Lynn Arlington

What about pulling all information then splitting it onto different sheets
using advanced filtering?

Lynn

"Dan B" wrote:

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




sebastienm

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

"Dan B" wrote:

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




Jared

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.

"sebastienm" wrote:

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

"Dan B" wrote:

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




Dan B

Thanks for the help....I'll give it a go and see what happens.





"Dan B" wrote in message
...
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





All times are GMT +1. The time now is 06:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com