M
mattdube
Hello,
I finished hacking a moderately complicated procedure to select data
joined on 2 tables - the text of which follows. For some reason, this
query will not run properly on my .adp. It works fine in SQL Mgt
Studio, and all other queries and procedures continue to work fine in
my .adp, its just this one query that doesnt work in Access. When I
run the procedure (either by my form I created or clicking on it in the
Queries container) I get "The stored procedure executed succesfully but
did not return records." To retierate: everything about this query
works except when it is called through my .adp. Maybe there's a
permission error or something - or maybe it has something to do with
nested Selects? Please offer advice.
Thanks!
Matt
--------------------------------------------------------------
Use db_ProdMeasurables;
go
create procedure sp_ShiftLaborJoined
@inDate smalldatetime,
@Shift Int
as
select distinct tbl_ExtrusionLaborData.EmployeeID,
sum(tbl_ExtrusionLaborData.Hours) as DirectHours
into #DirectHours
from tbl_ExtrusionLaborData
where
tbl_ExtrusionLaborData.Date = @inDate
and tbl_ExtrusionLaborData.Shift = @Shift
group by tbl_ExtrusionLaborData.EmployeeID
select distinct tbl_IndirectTime.EmployeeID,
sum(tbl_IndirectTime.Hours) as IndirectHours
into #InDirectHours
from tbl_IndirectTime
where
tbl_IndirectTime.Date = @inDate
and tbl_IndirectTime.Shift = @Shift
group by tbl_IndirectTime.EmployeeID
Select d.EmployeeID, DirectHours, IndirectHours,
sum(DirectHours) + sum(IndirectHours) as TotalHours
from #DirectHours d
join #InDirectHours i on i.EmployeeID = d.EmployeeID
group by d.EmployeeID, DirectHours, IndirectHours
I finished hacking a moderately complicated procedure to select data
joined on 2 tables - the text of which follows. For some reason, this
query will not run properly on my .adp. It works fine in SQL Mgt
Studio, and all other queries and procedures continue to work fine in
my .adp, its just this one query that doesnt work in Access. When I
run the procedure (either by my form I created or clicking on it in the
Queries container) I get "The stored procedure executed succesfully but
did not return records." To retierate: everything about this query
works except when it is called through my .adp. Maybe there's a
permission error or something - or maybe it has something to do with
nested Selects? Please offer advice.
Thanks!
Matt
--------------------------------------------------------------
Use db_ProdMeasurables;
go
create procedure sp_ShiftLaborJoined
@inDate smalldatetime,
@Shift Int
as
select distinct tbl_ExtrusionLaborData.EmployeeID,
sum(tbl_ExtrusionLaborData.Hours) as DirectHours
into #DirectHours
from tbl_ExtrusionLaborData
where
tbl_ExtrusionLaborData.Date = @inDate
and tbl_ExtrusionLaborData.Shift = @Shift
group by tbl_ExtrusionLaborData.EmployeeID
select distinct tbl_IndirectTime.EmployeeID,
sum(tbl_IndirectTime.Hours) as IndirectHours
into #InDirectHours
from tbl_IndirectTime
where
tbl_IndirectTime.Date = @inDate
and tbl_IndirectTime.Shift = @Shift
group by tbl_IndirectTime.EmployeeID
Select d.EmployeeID, DirectHours, IndirectHours,
sum(DirectHours) + sum(IndirectHours) as TotalHours
from #DirectHours d
join #InDirectHours i on i.EmployeeID = d.EmployeeID
group by d.EmployeeID, DirectHours, IndirectHours