Parameters in a Query

  • Thread starter Thread starter Popsie
  • Start date Start date
P

Popsie

I have a form that asks for a date input (DATE4). Then a query runs using
that date. It is supposed to get the data for that DATE4 - 6 days through
DATE4. I can't get the minus 6 days to work. Can someone please help :)

I have the following line in my Query

WHERE (((PUNCH.AdjustedDate) Between [FORMS]![MAIN]![DATE4]-6 And
[FORMS]![MAIN]![DATE4]));

It is not working, but when I just use

WHERE (((PUNCH.AdjustedDate) Between [FORMS]![MAIN]![DATE4] And
[FORMS]![MAIN]![DATE4]));

which is without the -6 then it works fine.

Thanks!!
 
Use the DateAdd function to add or subtract the required
number of time intervals.
lookup the DateAdd function in help and use the Expresion
builder as this helps with syntax.

Andy

between DateAdd("d",-6,[FORMS]![MAIN]![DATE4])
 
Back
Top