Good afternoon -
I have looked at your forum to try and get ideas of using pass-through query. I have setup a simple stored procedure and need to get it executed from Access as well as restrict based on the parameters of my Access form. My form has 3 text box fields that the data needs to limit to (startdate, enddate, clientname, site). Below is my stored procedure:
USE [TestDB]
GO
/****** Object: StoredProcedure [dbo].[pt_VemmaInsert] Script Date: 12/22/2015 1:46:40 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[pt_VemmaInsert]
AS
DECLARE @StartDate datetime;
DECLARE @EndDate datetime;
DECLARE @OWNERB varchar(Max);
DECLARE @SWHSB varchar(Max);
set @StartDate = @StartDate
set @EndDate = @EndDate
set @OWNERB = @OWNERB
set @SWHSB = @SWHSB
SELECT [SWHSB], [OWNERB] As Cust, COUNT(INSERTCHARGE) AS INSERTCHARGE
FROM [TestDB].[dbo].[VEMMA_INSERT]
WHERE SWHSB = @SWHSB And OWNERB=@OWNERB AND [SHIP Date] Between @StartDate And @EndDate
GROUP BY SWHSB, [OWNERB]
From Access, I created a pass-through query to execute the stored procedure (EXEC pt_VemmaInsert). When I run it, of course, nothing comes over. Based on what I have provided, can someone guide me in the right direction of revising my pass-through query to run my stored procedure and access only the data I need based on startdate, enddate, site, and client?
Thanks so much. :banghead:
I have looked at your forum to try and get ideas of using pass-through query. I have setup a simple stored procedure and need to get it executed from Access as well as restrict based on the parameters of my Access form. My form has 3 text box fields that the data needs to limit to (startdate, enddate, clientname, site). Below is my stored procedure:
USE [TestDB]
GO
/****** Object: StoredProcedure [dbo].[pt_VemmaInsert] Script Date: 12/22/2015 1:46:40 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[pt_VemmaInsert]
AS
DECLARE @StartDate datetime;
DECLARE @EndDate datetime;
DECLARE @OWNERB varchar(Max);
DECLARE @SWHSB varchar(Max);
set @StartDate = @StartDate
set @EndDate = @EndDate
set @OWNERB = @OWNERB
set @SWHSB = @SWHSB
SELECT [SWHSB], [OWNERB] As Cust, COUNT(INSERTCHARGE) AS INSERTCHARGE
FROM [TestDB].[dbo].[VEMMA_INSERT]
WHERE SWHSB = @SWHSB And OWNERB=@OWNERB AND [SHIP Date] Between @StartDate And @EndDate
GROUP BY SWHSB, [OWNERB]
From Access, I created a pass-through query to execute the stored procedure (EXEC pt_VemmaInsert). When I run it, of course, nothing comes over. Based on what I have provided, can someone guide me in the right direction of revising my pass-through query to run my stored procedure and access only the data I need based on startdate, enddate, site, and client?
Thanks so much. :banghead: