I have a Access SQL Pass-Through query that has a date parameter. I want to set this up so the user does not need to open the query to change the date parameter. Is there a way that the SQL query can collect the date from a text box on a form?
The query itself is run by a make table query. The make table query is run from a command button on a form.
The MSV_xxxxx tables are coming from a Great Plains database.
Thanks for your help.
Theresa Thompson
QryLabor Service Calls+: SQL Pass Through
Make tblUnsubmitted Labor - Step 1: Make Table Query
The query itself is run by a make table query. The make table query is run from a command button on a form.
The MSV_xxxxx tables are coming from a Great Plains database.
Thanks for your help.
Theresa Thompson
QryLabor Service Calls+: SQL Pass Through
Code:
SELECT
MSV_SVC00200.CALLNBR,
MSV_SVC00200.CUSTNMBR,
MSV_SVC00200.SVCDESCR,
MSV_SVC00200.ENTDTE,
MSV_SVC00300.SERLNMBR,
MSV_SVC00300.ITEMNMBR,
MSV_SVC00203.ITEMUSETYPE,
MSV_SVC00203.LNITMSEQ,
MSV_SVC00203.ITEMNMBR as PARTS,
MSV_SVC00203.RETDOCID,
MSV_SVC00203.QTYSOLD
FROM
(MSV_SVC00200(NOLOCK)
LEFT JOIN MSV_SVC00203(NOLOCK) ON MSV_SVC00200.CALLNBR = MSV_SVC00203.CALLNBR)
LEFT JOIN (MSV_SVC00300(NOLOCK)
RIGHT JOIN MSV_SVC00202(NOLOCK) ON MSV_SVC00300.EQUIPID = MSV_SVC00202.EQUIPID) ON MSV_SVC00200.CALLNBR = MSV_SVC00202.CALLNBR
WHERE
((MSV_SVC00200.SRVRECTYPE)=3)
and ((MSV_SVC00200.ENTDTE) BETWEEN '5/1/01' AND '6/30/01')
Make tblUnsubmitted Labor - Step 1: Make Table Query
Code:
SELECT
[qryLabor Service Calls+].*,
dbo_MSV_SVC05000.BINNMBR,
dbo_MSV_SVC05000.REFRENCE,
IIf([REFRENCE] Like '####*',Left$([REFRENCE],4)) AS [Warranty Code],
IIf([REFRENCE] Like '####*',Mid$([REFRENCE],6,20)) AS [Reference #],
dbo_MSV_SVC05000.USRDEF04,
dbo_MSV_SVC05000.USRDEF05
INTO tblTemp
FROM [qryLabor Service Calls+]
LEFT JOIN dbo_MSV_SVC05000 ON [qryLabor Service Calls+].RETDOCID = dbo_MSV_SVC05000.RETDOCID;