simple query question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a report with this source :

SELECT emp.ename, data.t1In, data.edate, data.t1Out, data.t2In, data.t2Out,
emp.eid, Format([edate],"mm") AS [Month]
FROM emp INNER JOIN data ON emp.eid = data.EID
WHERE (((Format([edate],"mm"))= " & month_var & "));

the month_var is a predefined public string and contain a value, so why the
report will still ask me to enter the value again?
 
Sensay said:
i have a report with this source :

SELECT emp.ename, data.t1In, data.edate, data.t1Out, data.t2In,
data.t2Out, emp.eid, Format([edate],"mm") AS [Month]
FROM emp INNER JOIN data ON emp.eid = data.EID
WHERE (((Format([edate],"mm"))= " & month_var & "));

the month_var is a predefined public string and contain a value, so
why the report will still ask me to enter the value again?

Queries cannot access VBA variables. You need a wrapper fuction that returns
the value of the variable as custom functions can be used in a query.
 
Back
Top