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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top