Pass Through query problem

garyh_uk

New member
Local time
Today, 16:05
Joined
Mar 13, 2012
Messages
3
Hi

I want to build a pass through query for a large query I need to run. I understand how to do it except for 2 things:

1. In the query I have a calculated field which basically works out from 2 dates, which is the most recent and returns the values based on that. So for example:

iif(isnull([modified]),[created],iif([modified]>=[created],[modified],[created])

2. The query runs from a form where the user inputs 2 dates. The calculated field above refers to the date range returned by the form, so, for example, in the criteria of the field above, it says something like:

Between [forms......]StartDate and [forms......]EndDate


Can I build this into the Pass Through query in any way? Thanks
 
Pass through to what? IIf() is not valid in SQL Server for example; you'd replace with a CASE statement.

To handle form references, I suspect most of us build the SQL in code, concatenating the values from the form references into the string, and change the SQL of the query with a QueryDef.
 

Users who are viewing this thread

Back
Top Bottom