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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date range for a report



 
 
Thread Tools Display Modes
  #1  
Old December 30th, 2009, 09:45 PM posted to microsoft.public.access.queries
Tracey
external usenet poster
 
Posts: 138
Default Date range for a report

Hi

I am trying to run a query and can't seem to nail down the right code.
We use the access database to track files, incoming/outgoing correspondence
dates etc.
I am trying to run a query that show me files with dates in a follow up
field of -60 days to +7 days, so essentially any follow ups missed in the
last 2 months and up coming in the next week.
This report is run on a weekly basis.

Appreciate any help

Thanks

  #2  
Old December 30th, 2009, 09:52 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Date range for a report

Assuming that the follow up field is actually a date/time data type, try this
in the criteria:

Between Date() - 60 and Date() + 7
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Tracey" wrote:

Hi

I am trying to run a query and can't seem to nail down the right code.
We use the access database to track files, incoming/outgoing correspondence
dates etc.
I am trying to run a query that show me files with dates in a follow up
field of -60 days to +7 days, so essentially any follow ups missed in the
last 2 months and up coming in the next week.
This report is run on a weekly basis.

Appreciate any help

Thanks

  #3  
Old December 30th, 2009, 10:24 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Date range for a report

On Wed, 30 Dec 2009 13:45:01 -0800, Tracey
wrote:

Hi

I am trying to run a query and can't seem to nail down the right code.
We use the access database to track files, incoming/outgoing correspondence
dates etc.
I am trying to run a query that show me files with dates in a follow up
field of -60 days to +7 days, so essentially any follow ups missed in the
last 2 months and up coming in the next week.
This report is run on a weekly basis.

Appreciate any help

Thanks


= DateAdd("d", -60, Date()) AND DateAdd("d", 8, Date())


will work (even if the datefield contains a time portion, hence the 8)

--

John W. Vinson [MVP]
  #4  
Old December 31st, 2009, 03:31 PM posted to microsoft.public.access.queries
Tracey
external usenet poster
 
Posts: 138
Default Date range for a report

Thanks guys!
Happy New Year!

"John W. Vinson" wrote:

On Wed, 30 Dec 2009 13:45:01 -0800, Tracey
wrote:

Hi

I am trying to run a query and can't seem to nail down the right code.
We use the access database to track files, incoming/outgoing correspondence
dates etc.
I am trying to run a query that show me files with dates in a follow up
field of -60 days to +7 days, so essentially any follow ups missed in the
last 2 months and up coming in the next week.
This report is run on a weekly basis.

Appreciate any help

Thanks


= DateAdd("d", -60, Date()) AND DateAdd("d", 8, Date())


will work (even if the datefield contains a time portion, hence the 8)

--

John W. Vinson [MVP]
.

 




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:43 AM.


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