|
Posted by Tom van Stiphout on 01/02/08 14:28
On Wed, 2 Jan 2008 05:06:50 -0800 (PST), gumby
<gumbysolutions@cox.net> wrote:
You have to replace the parameters before submitting the query.
sql = "select ..."
sql = replace(sql, @StartDate, "'1/1/2008'")
(note the single-quotes around the date)
sql = replace(sql, @EndDate, "'12/31/2008'")
-Tom.
>I would like to call this stored procedure, but I am unable to pass
>parameters to the @Start and @End.
>
>Is thier a way to pass parameters to a pass through query from MS
>Access?
>
>SELECT COUNT(dbo.tblPersActionHistory.PersActionID) AS [Total Ct],
>[dbo].fn_FindStartPayPeriod(dbo.tblPersActionHistory.PersActionID, 2)
> AS [Signed PP]
>FROM dbo.tblPersActionLog INNER JOIN
> dbo.tblPersActionHistory ON
>dbo.tblPersActionLog.PersActionID =
>dbo.tblPersActionHistory.PersActionID
>WHERE (dbo.tblPersActionLog.StatusID BETWEEN 4 AND 7) AND
>(dbo.tblPersActionLog.Rejected = 0) AND
>(dbo.tblPersActionLog.IsPayAction = 0) AND
> (dbo.tblPersActionHistory.ActionTypeID = 5) AND
>(dbo.fn_IsParACorrection(dbo.tblPersActionHistory.PersActionID) = 0)
>AND
>
>([dbo].fn_ParNotException(dbo.tblPersActionHistory.PersActionID) = 1)
>AND (dbo.tblPersActionHistory.ItemDTG >= @StartDate) AND
> (dbo.tblPersActionHistory.ItemDTG <= @EndDate)
>GROUP BY
>[dbo].fn_FindStartPayPeriod(dbo.tblPersActionHistory.PersActionID, 2)
Navigation:
[Reply to this message]
|