dbTalk Databases Forums  

Can DTS do this?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Can DTS do this? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Drew
 
Posts: n/a

Default Can DTS do this? - 07-22-2005 , 03:10 PM






I have a report which I have to complete every quarter. The report is done
in Excel and is called, "Agency Training Metrics Report". There are 20
categories which our training courses fall in. The report is broken into 2
sides, Supervisor and Non-Supervisor and lists all the categories in rows
and has 6 columns, A, B, C, D, E, F which represent race codes,

A= White
B= Black
C= Hispanic
D= Asian/Pacific Islander
E= American Indian
F= Unknown

It also looks for Male and Female,

In essence, the report is for showing the totals between all the variables,
i.e. All Black Male Non-Supervisors who have had a training course in
Executive Development category OR All Hispanic Female Supervisors who have
had a training course in Business Practices, Quality and Competition
category.

This report is cumbersome and long, but I developed 2 Stored Procedures to
give me this data and outputted it into a Access ADP file for reporting. I
would like to skip that step and try to get the data directly into the Excel
file instead.

The stored procedures that I developed are the same, except one looks for
Supervisors and the other looks for Non-Supervisors. Currently my SP only
returns the Category and Employee # for each course taken. I'm not sure how
to output all the data needed. Here are my SP's,

CREATE PROCEDURE spMetricsCollection_Supervisors
@EmpSex varchar(1),
@EmpRace char(1),
@StartDate datetime,
@EndDate datetime
AS
SELECT E.EmpID, CAT.Cat
FROM Courses C INNER JOIN Category CAT ON C.CatID = CAT.CatID INNER JOIN
ClassesTaught CT ON C.CourseTitle = CT.Title
INNER JOIN Training T ON CT.ClassNo = T.ClassNo INNER JOIN
EmpCore.dbo.tblEmployee E ON T.EmployeeNo = E.EmpID
INNER JOIN EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID = EP.EmpID INNER
JOIN EmpCore.dbo.tblPosition P ON E.PosID = P.PosID
WHERE EP.EmpSex = @EmpSex AND
(CT.StartDate BETWEEN @StartDate AND @EndDate) AND (EndDate BETWEEN
@StartDate AND @EndDate) AND
EP.EmpRace = @EmpRace AND P.PosSupervisor = 1
ORDER BY EmpLName
GO

CREATE PROCEDURE spMetricsCollection_NonSupervisors
@EmpSex varchar(1),
@EmpRace char(1),
@StartDate datetime,
@EndDate datetime
AS
--Supervisors
SELECT E.EmpID, CAT.Cat
FROM Courses C INNER JOIN Category CAT ON C.CatID = CAT.CatID INNER JOIN
ClassesTaught CT ON C.CourseTitle = CT.Title
INNER JOIN Training T ON CT.ClassNo = T.ClassNo INNER JOIN
EmpCore.dbo.tblEmployee E ON T.EmployeeNo = E.EmpID
INNER JOIN EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID = EP.EmpID INNER
JOIN EmpCore.dbo.tblPosition P ON E.PosID = P.PosID
WHERE EP.EmpSex = @EmpSex AND
(CT.StartDate BETWEEN @StartDate AND @EndDate) AND (EndDate BETWEEN
@StartDate AND @EndDate) AND
EP.EmpRace = @EmpRace AND P.PosSupervisor IS NULL
ORDER BY EmpLName
GO

Can I accomplish this with DTS? After my primer (with mounds of help from
this group) I feel pretty comfortable with DTS, but still am not sure how to
go about doing this. The Excel file has calculations and is formatted, so
it's not like a blank file.

Thanks,
Drew Laing



Reply With Quote
  #2  
Old   
frank chang
 
Posts: n/a

Default RE: Can DTS do this? - 07-24-2005 , 07:23 AM






Drew, Yes, DTS should be able to do this. Do you have a hotmail, yahoo, aol,
or gmail account? I need a little more information about requirement before I
can propose a solution. Thank you.

"Drew" wrote:

Quote:
I have a report which I have to complete every quarter. The report is done
in Excel and is called, "Agency Training Metrics Report". There are 20
categories which our training courses fall in. The report is broken into 2
sides, Supervisor and Non-Supervisor and lists all the categories in rows
and has 6 columns, A, B, C, D, E, F which represent race codes,

A= White
B= Black
C= Hispanic
D= Asian/Pacific Islander
E= American Indian
F= Unknown

It also looks for Male and Female,

In essence, the report is for showing the totals between all the variables,
i.e. All Black Male Non-Supervisors who have had a training course in
Executive Development category OR All Hispanic Female Supervisors who have
had a training course in Business Practices, Quality and Competition
category.

This report is cumbersome and long, but I developed 2 Stored Procedures to
give me this data and outputted it into a Access ADP file for reporting. I
would like to skip that step and try to get the data directly into the Excel
file instead.

The stored procedures that I developed are the same, except one looks for
Supervisors and the other looks for Non-Supervisors. Currently my SP only
returns the Category and Employee # for each course taken. I'm not sure how
to output all the data needed. Here are my SP's,

CREATE PROCEDURE spMetricsCollection_Supervisors
@EmpSex varchar(1),
@EmpRace char(1),
@StartDate datetime,
@EndDate datetime
AS
SELECT E.EmpID, CAT.Cat
FROM Courses C INNER JOIN Category CAT ON C.CatID = CAT.CatID INNER JOIN
ClassesTaught CT ON C.CourseTitle = CT.Title
INNER JOIN Training T ON CT.ClassNo = T.ClassNo INNER JOIN
EmpCore.dbo.tblEmployee E ON T.EmployeeNo = E.EmpID
INNER JOIN EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID = EP.EmpID INNER
JOIN EmpCore.dbo.tblPosition P ON E.PosID = P.PosID
WHERE EP.EmpSex = @EmpSex AND
(CT.StartDate BETWEEN @StartDate AND @EndDate) AND (EndDate BETWEEN
@StartDate AND @EndDate) AND
EP.EmpRace = @EmpRace AND P.PosSupervisor = 1
ORDER BY EmpLName
GO

CREATE PROCEDURE spMetricsCollection_NonSupervisors
@EmpSex varchar(1),
@EmpRace char(1),
@StartDate datetime,
@EndDate datetime
AS
--Supervisors
SELECT E.EmpID, CAT.Cat
FROM Courses C INNER JOIN Category CAT ON C.CatID = CAT.CatID INNER JOIN
ClassesTaught CT ON C.CourseTitle = CT.Title
INNER JOIN Training T ON CT.ClassNo = T.ClassNo INNER JOIN
EmpCore.dbo.tblEmployee E ON T.EmployeeNo = E.EmpID
INNER JOIN EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID = EP.EmpID INNER
JOIN EmpCore.dbo.tblPosition P ON E.PosID = P.PosID
WHERE EP.EmpSex = @EmpSex AND
(CT.StartDate BETWEEN @StartDate AND @EndDate) AND (EndDate BETWEEN
@StartDate AND @EndDate) AND
EP.EmpRace = @EmpRace AND P.PosSupervisor IS NULL
ORDER BY EmpLName
GO

Can I accomplish this with DTS? After my primer (with mounds of help from
this group) I feel pretty comfortable with DTS, but still am not sure how to
go about doing this. The Excel file has calculations and is formatted, so
it's not like a blank file.

Thanks,
Drew Laing




Reply With Quote
  #3  
Old   
Drew
 
Posts: n/a

Default Re: Can DTS do this? - 07-25-2005 , 09:45 AM



Yes... I have a gmail account, dr00bertNOSPAMgmailDOTcom (note: two zeros
instead of o's)

replace NOSPAM and DOT

Drew

"frank chang" <frankchang (AT) discussions (DOT) microsoft.com> wrote

Quote:
Drew, Yes, DTS should be able to do this. Do you have a hotmail, yahoo,
aol,
or gmail account? I need a little more information about requirement
before I
can propose a solution. Thank you.

"Drew" wrote:

I have a report which I have to complete every quarter. The report is
done
in Excel and is called, "Agency Training Metrics Report". There are 20
categories which our training courses fall in. The report is broken into
2
sides, Supervisor and Non-Supervisor and lists all the categories in rows
and has 6 columns, A, B, C, D, E, F which represent race codes,

A= White
B= Black
C= Hispanic
D= Asian/Pacific Islander
E= American Indian
F= Unknown

It also looks for Male and Female,

In essence, the report is for showing the totals between all the
variables,
i.e. All Black Male Non-Supervisors who have had a training course in
Executive Development category OR All Hispanic Female Supervisors who
have
had a training course in Business Practices, Quality and Competition
category.

This report is cumbersome and long, but I developed 2 Stored Procedures
to
give me this data and outputted it into a Access ADP file for reporting.
I
would like to skip that step and try to get the data directly into the
Excel
file instead.

The stored procedures that I developed are the same, except one looks for
Supervisors and the other looks for Non-Supervisors. Currently my SP
only
returns the Category and Employee # for each course taken. I'm not sure
how
to output all the data needed. Here are my SP's,

CREATE PROCEDURE spMetricsCollection_Supervisors
@EmpSex varchar(1),
@EmpRace char(1),
@StartDate datetime,
@EndDate datetime
AS
SELECT E.EmpID, CAT.Cat
FROM Courses C INNER JOIN Category CAT ON C.CatID = CAT.CatID INNER JOIN
ClassesTaught CT ON C.CourseTitle = CT.Title
INNER JOIN Training T ON CT.ClassNo = T.ClassNo INNER JOIN
EmpCore.dbo.tblEmployee E ON T.EmployeeNo = E.EmpID
INNER JOIN EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID = EP.EmpID
INNER
JOIN EmpCore.dbo.tblPosition P ON E.PosID = P.PosID
WHERE EP.EmpSex = @EmpSex AND
(CT.StartDate BETWEEN @StartDate AND @EndDate) AND (EndDate BETWEEN
@StartDate AND @EndDate) AND
EP.EmpRace = @EmpRace AND P.PosSupervisor = 1
ORDER BY EmpLName
GO

CREATE PROCEDURE spMetricsCollection_NonSupervisors
@EmpSex varchar(1),
@EmpRace char(1),
@StartDate datetime,
@EndDate datetime
AS
--Supervisors
SELECT E.EmpID, CAT.Cat
FROM Courses C INNER JOIN Category CAT ON C.CatID = CAT.CatID INNER JOIN
ClassesTaught CT ON C.CourseTitle = CT.Title
INNER JOIN Training T ON CT.ClassNo = T.ClassNo INNER JOIN
EmpCore.dbo.tblEmployee E ON T.EmployeeNo = E.EmpID
INNER JOIN EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID = EP.EmpID
INNER
JOIN EmpCore.dbo.tblPosition P ON E.PosID = P.PosID
WHERE EP.EmpSex = @EmpSex AND
(CT.StartDate BETWEEN @StartDate AND @EndDate) AND (EndDate BETWEEN
@StartDate AND @EndDate) AND
EP.EmpRace = @EmpRace AND P.PosSupervisor IS NULL
ORDER BY EmpLName
GO

Can I accomplish this with DTS? After my primer (with mounds of help
from
this group) I feel pretty comfortable with DTS, but still am not sure how
to
go about doing this. The Excel file has calculations and is formatted,
so
it's not like a blank file.

Thanks,
Drew Laing






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.