SQL Statement

N

news

Is it possible to have a variable in the HAVING statement instead of the
field [FLDVST.Dt_Visited]? When I use a variable and run the statement the
query ask for a parameter for the variable, it think it's a field. When I
look at the design of the query it added the variable as a field. Thanks.


Set db = CurrentDb()
strSQLSelect = _
"SELECT " _
& "[TW: ProvidersContractEffDate].[Key Name], " _
& "FROM [TW: ProvidersContractEffDate]
& "GROUP BY [TW: ProvidersContractEffDate].[Key Name]

& "HAVING (((FLDVST.Dt_Visited) " _

& "Between #" _

& [Forms]![TW: Reports]![StrDate] & "# " _

& "And " _

& [Forms]![TW: Reports]![EndDate] & "#) ")) _
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SQL Statement 2
SQL Statement 0
Active Content in this file is blocked issue 1
update queries 2
Make Table Query 6
query variables 2
Problem with Filter in Mail Merge 0
Template with fields and premade texts.. 0

Top