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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |