Where clause in a pass thorugh query

djcritter

New member
Local time
Today, 13:29
Joined
Jan 19, 2006
Messages
6
Hello

Any hellp would be appericated.

I have a pass thorugh query that connets to a Oracle database with a where clause with a between start date and end date.

I need the start date and End Date to come from a form within MS Access.

Is this possible? if so how do I code the where clause to get the start and end date parameters from the form?
 
Not too sure what a pass-through query is but i have a similar query which takes yearstart and yearend from a form, may help then again may not...


SELECT qryAmbCatA8.MonthEnding, qryAmbCatA8.TotalCatAResp AS [Total Category A Responses], qryAmbCatA8.Performance, qryAmbCatA8.Target
FROM qryAmbCatA8
GROUP BY qryAmbCatA8.MonthEnding, qryAmbCatA8.TotalCatAResp, qryAmbCatA8.Performance, qryAmbCatA8.Target
HAVING (((qryAmbCatA8.MonthEnding) Between [Forms]![frmAmbulanceReports]![txtCurrentYearStart] And [Forms]![frmAmbulanceReports]![txtCurrentYearEnding]));

Regards - Ian
 
You can't supply parameters to a pass through query. To accomplish your task your are going to have to contruct the SQL statement when the user click the retrieve button on your form to include the values of the textboxes on your form and then run the query.
 
You don't need to use a pass-through query at all. Jet makes every effort to pass-through EVERY query so there is only a minor difference between you creating and running a pass-through query and using a standard Access parameter query. When you define the Access query, specify the recordset type to be snapshot since you don't need to update it. That will make the pass-through and the Jet queries virtually identical.
 

Users who are viewing this thread

Back
Top Bottom