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

Date Range for Reports



 
 
Thread Tools Display Modes
  #1  
Old September 19th, 2005, 08:36 PM
5843
external usenet poster
 
Posts: n/a
Default Date Range for Reports

I have a button on a form that opens 3 reports. Each report needs to be
filtered by different date ranges. I can set up each one with a query
criteria of [Enter End Date] and [Enter start date], but this would have the
user putting in 6 dates...I'd prefer to have the report filter automatically.


For example, report only if a Test Date was within 60 days of today, a
Medication was within 120 days of today, etc...

Any thoughts?
  #2  
Old September 19th, 2005, 08:54 PM
Rick B
external usenet poster
 
Posts: n/a
Default

Then just change the criteria in your query.

For "within 60 days of today" use Date()-60

For within 120, use Date()-120

etc.



--
Rick B



"5843" wrote in message
...
I have a button on a form that opens 3 reports. Each report needs to be
filtered by different date ranges. I can set up each one with a query
criteria of [Enter End Date] and [Enter start date], but this would have

the
user putting in 6 dates...I'd prefer to have the report filter

automatically.


For example, report only if a Test Date was within 60 days of today, a
Medication was within 120 days of today, etc...

Any thoughts?



  #3  
Old September 19th, 2005, 08:58 PM
Ofer
external usenet poster
 
Posts: n/a
Default

I'm not sure if that what you are looking for, but try this

Select * From TableName Where [Test Date] Between DateAdd("d",-60,Date())
and Date()

Select * From TableName Where [Medication] Between DateAdd("d",-120,Date())
and Date()

--
I hope that helped
Good luck


"5843" wrote:

I have a button on a form that opens 3 reports. Each report needs to be
filtered by different date ranges. I can set up each one with a query
criteria of [Enter End Date] and [Enter start date], but this would have the
user putting in 6 dates...I'd prefer to have the report filter automatically.


For example, report only if a Test Date was within 60 days of today, a
Medication was within 120 days of today, etc...

Any thoughts?

  #4  
Old September 19th, 2005, 09:09 PM
Ofer
external usenet poster
 
Posts: n/a
Default

To correct myself

Select * From TableName Where [Test Date] Between Date() And
DateAdd("d",60,Date())


Select * From TableName Where [Medication] Between Date() And
DateAdd("d",120,Date())


--
I hope that helped
Good luck


"Ofer" wrote:

I'm not sure if that what you are looking for, but try this

Select * From TableName Where [Test Date] Between DateAdd("d",-60,Date())
and Date()

Select * From TableName Where [Medication] Between DateAdd("d",-120,Date())
and Date()

--
I hope that helped
Good luck


"5843" wrote:

I have a button on a form that opens 3 reports. Each report needs to be
filtered by different date ranges. I can set up each one with a query
criteria of [Enter End Date] and [Enter start date], but this would have the
user putting in 6 dates...I'd prefer to have the report filter automatically.


For example, report only if a Test Date was within 60 days of today, a
Medication was within 120 days of today, etc...

Any thoughts?

 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
querie Criteria date range and find records on ProductType Rodrigo R via AccessMonster.com Running & Setting Up Queries 1 August 5th, 2005 11:26 PM
Query for 'confirmation' rogge Running & Setting Up Queries 8 April 19th, 2005 03:26 PM
adding occurrences for date range Mike General Discussion 0 April 8th, 2005 11:33 PM
adding occurrences for date range Mike General Discussion 1 April 8th, 2005 11:31 PM
Cancel print on subreport based on date range Miss Kait Setting Up & Running Reports 4 October 11th, 2004 03:19 PM


All times are GMT +1. The time now is 09:07 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.