Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 copy data to differnt excel files

Author  Topic 

jamie
Aged Yak Warrior

542 Posts

Posted - 2004-05-10 : 05:55:52
hello,
I am currently using dts to copy data from sql server 7 to an excel file, however the data now does not fit into one spreadsheet.
how can I copy data where date is in january to one spreadsheet, copy data where date is in february to another spreadsheet, , and so on ?
is this possible ?

thanks.

X002548
Not Just a Number

15586 Posts

Posted - 2004-05-10 : 15:49:29
Well

You can create a VIEW to separate the data...

But to my knowledge is 1 page per book that get created every time...

you have to put it together manually

I think....If you have some naming standard, I guess you could write a macro...



Brett

8-)
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-05-11 : 02:13:30
Jamie,

You could possibly do this using an ActiveX script in the DTS package. You will then be able to manipulate the spreadsheet as much as you want, provided you know the Excel object model...

Tim
Go to Top of Page

jamie
Aged Yak Warrior

542 Posts

Posted - 2004-05-11 : 07:42:15
no, I don't know activex scripting, do you know any good sites with examples ?

I need to break up the data before getting to excel as its more data than excel can handle.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-05-11 : 10:43:07
CREATE VIEW myView99
AS
SELECT Collist
FROM myTAble99
WHERE myDateCol99 >= '1/1/2004'
AND myDateCol99 <= '1/31/2004 23:59:59:59'
GO

Then bcp out the view....



Brett

8-)
Go to Top of Page

jamie
Aged Yak Warrior

542 Posts

Posted - 2004-05-12 : 05:05:47
thats an idea Brett, but its not really very automated, I'll need to keep changing the dates, and also run it for each month.
IT would be nice to run it as a job or something automatically once a year and that splits the data.
I think this may be too complicated.
thanks anyway
Go to Top of Page
   

- Advertisement -