A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date



 
 
Thread Tools Display Modes
  #1  
Old September 11th, 2008, 11:51 PM posted to microsoft.public.access.tablesdbdesign
Gilbo
external usenet poster
 
Posts: 18
Default Date

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.
  #2  
Old September 12th, 2008, 01:22 AM posted to microsoft.public.access.tablesdbdesign
Steve[_57_]
external usenet poster
 
Posts: 598
Default Date

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

"Gilbo" wrote in message
...
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.



  #3  
Old September 12th, 2008, 03:03 AM posted to microsoft.public.access.tablesdbdesign
tina
external usenet poster
 
Posts: 1,997
Default Date

Between InputtedDate - 4 And InputtedDate + 4

or

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

hth


"Gilbo" wrote in message
...
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.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:21 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.