D
Drew
I am using Access for reporting from SQL Server and would like to know if it
is possible to programmatically turn off grouping in Access. The report is
generated from a stored procedure and can generate 2 different recordsets.
The first report (by 0,1,2) is a good deal of records, but the second report
(by 3) has only like 10 records. I would like to be able to turn off the
grouping if the user wants the second report. I have the following stored
procedure,
CREATE PROCEDURE spCheckReceiving
@Shift int
AS
IF @Shift = 1
SELECT TOP 100 PERCENT E.EmpID, E.EmpFName, E.EmpMName, E.EmpLName,
EP.EmpSSN, P.PosTimeKeeper, D.DeptName
FROM dbo.tblEmpInfo EF INNER JOIN
EmpCore.dbo.tblEmployee E ON EF.EmpID = E.EmpID INNER
JOIN
EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID =
EP.EmpID INNER JOIN
EmpCore.dbo.tblPosition P ON E.PosID = P.PosID INNER
JOIN
EmpCore.dbo.tblTimeKeepers TK ON P.PosTimeKeeper =
TK.TimeKeeperID INNER JOIN
EmpCore.dbo.tblDept D ON P.PosDeptID = D.DeptID
WHERE (E.EmpActive = 1) AND (EF.EmpDirectDeposit = 0) AND (E.EmpShift =
1 OR E.EmpShift = 2 OR E.EmpShift = 0)
ORDER BY E.EmpLName, E.EmpFName
ELSE
SELECT TOP 100 PERCENT E.EmpID, E.EmpFName, E.EmpMName, E.EmpLName,
EP.EmpSSN, P.PosTimeKeeper, D.DeptName
FROM dbo.tblEmpInfo EF INNER JOIN
EmpCore.dbo.tblEmployee E ON EF.EmpID = E.EmpID INNER
JOIN
EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID =
EP.EmpID INNER JOIN
EmpCore.dbo.tblPosition P ON E.PosID = P.PosID INNER
JOIN
EmpCore.dbo.tblTimeKeepers TK ON P.PosTimeKeeper =
TK.TimeKeeperID INNER JOIN
EmpCore.dbo.tblDept D ON P.PosDeptID = D.DeptID
WHERE (E.EmpActive = 1) AND (EF.EmpDirectDeposit = 0) AND (E.EmpShift =
3)
ORDER BY E.EmpLName, E.EmpFName
GO
Is this possible?
Thanks,
Drew Laing
is possible to programmatically turn off grouping in Access. The report is
generated from a stored procedure and can generate 2 different recordsets.
The first report (by 0,1,2) is a good deal of records, but the second report
(by 3) has only like 10 records. I would like to be able to turn off the
grouping if the user wants the second report. I have the following stored
procedure,
CREATE PROCEDURE spCheckReceiving
@Shift int
AS
IF @Shift = 1
SELECT TOP 100 PERCENT E.EmpID, E.EmpFName, E.EmpMName, E.EmpLName,
EP.EmpSSN, P.PosTimeKeeper, D.DeptName
FROM dbo.tblEmpInfo EF INNER JOIN
EmpCore.dbo.tblEmployee E ON EF.EmpID = E.EmpID INNER
JOIN
EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID =
EP.EmpID INNER JOIN
EmpCore.dbo.tblPosition P ON E.PosID = P.PosID INNER
JOIN
EmpCore.dbo.tblTimeKeepers TK ON P.PosTimeKeeper =
TK.TimeKeeperID INNER JOIN
EmpCore.dbo.tblDept D ON P.PosDeptID = D.DeptID
WHERE (E.EmpActive = 1) AND (EF.EmpDirectDeposit = 0) AND (E.EmpShift =
1 OR E.EmpShift = 2 OR E.EmpShift = 0)
ORDER BY E.EmpLName, E.EmpFName
ELSE
SELECT TOP 100 PERCENT E.EmpID, E.EmpFName, E.EmpMName, E.EmpLName,
EP.EmpSSN, P.PosTimeKeeper, D.DeptName
FROM dbo.tblEmpInfo EF INNER JOIN
EmpCore.dbo.tblEmployee E ON EF.EmpID = E.EmpID INNER
JOIN
EmpPersonal.dbo.tblEmpPersonalInfo EP ON E.EmpID =
EP.EmpID INNER JOIN
EmpCore.dbo.tblPosition P ON E.PosID = P.PosID INNER
JOIN
EmpCore.dbo.tblTimeKeepers TK ON P.PosTimeKeeper =
TK.TimeKeeperID INNER JOIN
EmpCore.dbo.tblDept D ON P.PosDeptID = D.DeptID
WHERE (E.EmpActive = 1) AND (EF.EmpDirectDeposit = 0) AND (E.EmpShift =
3)
ORDER BY E.EmpLName, E.EmpFName
GO
Is this possible?
Thanks,
Drew Laing