I currently have a query that uses a date field from a form. Everything compiles fine, the problem is when I try an expand on this. I want to specify a date one day ahead of the date displayed on the form. My current SQL used to grab the date is
WHERE ((DateValue([TIMESTAMP]))=[Forms]![Frm_Start]![Date])
However when I try to add + 1 to the end it displays this message:
The expression is typed incorrectly, or is too complex to be evaluated.
Any advice would be greatly appreciated.
Use a
PARAMETERSclause as the first line of your SQL to inform the db engine the form control contains a Date/Time value.Then use the parameter with
DateAdd()in your WHERE clause:However, that will require running
DateValue()for every row in the table. This should be faster with[TIMESTAMP]indexed: