Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Probs with Export Job

Status
Not open for further replies.

sedgely

Technical User
Feb 21, 2002
406
GB
i have created a DTS job to export data into Excel, something i have done many times with no problems.
however, with this job i am tearing my hair out coz everything seems OK but it will not work...
The job consists of 2 'Execute SQl tasks' to drop and create the table as below:
Code:
drop table `MasterData$`
and
Code:
CREATE TABLE `MasterData$` (
`RECORDNUMBER` VarChar (255) , 
`DATE` DateTime , 
`MINRESP` VarChar (255) , 
`EXRESP` VarChar (255) , 
`NOTES` VarChar (255) 
)
and then a 'transform data task' using the following query:
Code:
SELECT recordnumber, [date], minresp,exresp, notes
FROM incidents 
WHERE (YEAR([date]) = YEAR(DATEADD(m, -1, GETDATE()))
	AND MONTH([date]) = MONTH(DATEADD(m, -1, GETDATE())))
	AND type LIKE 'u%'
	AND minresp <>'999'
	AND NOT minresp IS NULL
	AND minresp <>''
	AND cast(minresp as real) > 15.01

The Excel spreadsheet consists of one sheet titled 'MasterData'.
The first time i ran the package it worked fine, but on subsequent runs it completes OK and tells me how many rows have been copied but when i open the spreadsheet there is no data, just the column headings.
If i then insert a new worksheet, delete the existing sheet and rename the new sheet to 'MasterData' and re-run the job, the job completes and the data is copied. However next time it is run again no data.
This is really driving me mad [hairpull].
Can anyone help?

Cheers, Craig
Si fractum non sit, noli id reficere
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top