Syntax Error

JEA

Registered User.
Local time
Today, 08:51
Joined
Nov 2, 2007
Messages
83
This line keeps throwing an error:

Code:
 DLookup("[NoOfStaffRequired]", "Hours", "[DateWorked] = " & WorkedDay)

WorkedDay is a variable passed as a Short Date in to the function. It is Declared As Date.

The [DateWorked] field in the 'Hours' table contains Short Dates.

The error I keep getting is:

Syntax error (missing operator) in query expression '[DateWorked]=00:37:24'.

and:

Run-time error '3075':
|1 in query expression '|2'.

I've got a feeling it's to do with the way I'm concatonating the string. Please help.
 
Last edited:
Try:
DLookup("[NoOfStaffRequired]", "Hours", "[DateWorked] = #" & WorkedDay & "#")
 
It worked

Thanks (again) :)
 
Try this

DLookup("[NoOfStaffRequired]", "Hours", "[DateWorked] = #" & WorkedDay & "#")
 

Users who are viewing this thread

Back
Top Bottom