Re: dateadd embedded in dlookup problem

Tech-Archive recommends: Speed Up your PC by fixing your registry



Thanks for the response John,
Unfortunatly, that still doesn't work.
I have confirmed that
dateadd('d',17, [mdate] )
works ok, and all the rest of the querie works ok,
It just seems to be the dateadd within the Dlookup having [mdate]
outside of the inverted commas that seems to be the problem.
I've tried putting mdate inside the inverted commas, but access complains.
[mdate] has been declared a date/time in parameters.

Thanks
Adrian

John Spencer wrote:
Try the following. You need to add the "#" delimiter to the criteria so MDate
will be interpreted as a date.

Expr3: DLookUp("approved","tblLeave"
,"EmployeeID=5 AND [Start Date]<= dateadd('d',17,#" & [mdate] & "#) AND
Day([End Date])>=18")

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200609/1

.