Date

G

Gilbo

How do I write a query that when someone serches for a date in my date field
it will return dates four days before and four day after, the date that was
inputted.
 
S

Steve

Assuming the search date is entered in MyDate on the form MyForm, use the
following expression in the criteria of your date field:

Between DateAdd("d",-4,Forms!MyForm!MyDate) And
DateAdd("d",4,Forms!MyForm!MyDate)

Steve
 
T

tina

Between InputtedDate - 4 And InputtedDate + 4

or

Between DateAdd("d", -4, InputtedDate) And DateAdd("d", 4, InputtedDate)

hth
 
Top