Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Parameter: allowing multiple values - NOT dates but Ranges 2

Status
Not open for further replies.

zupnik

Technical User
Sep 21, 2004
28
US
CR: 8.5
DM Access 2003

Due to a different schedule between our fiscal calendar and the CR calendar, I would like to know if the following is possible:

When a user refreshes the report a date parameter field pops up and lets him choose from a list of months by name, i.e January 2005, February 2005..... January 2006.

Also, where would I 'define' when February starts and ends. In my case start day for Feb 2005 is January 30 and end date is February 26.


Thanks for all the help.
Z.
 
Hi,
Where are the prompt values coming from?
You could create default parameter values that define your calendar structure and use that as the source for the default parameter values..You do not need an 'Actual' calendar just a list of Month..Year , for instance:
{?WhatPeriod}
Default
Values Desc
1 January 2005
2 February 2005
...etc.

Then, in your record selection criteria, you could use:

If {?WhatPeriod} = 1 then
{DateField} in Date(2005,01,01) to Date(2005,01,29)
else
If {?WhatPeriod} = 2 then
{DateField} in Date(2005,01,30) to Date(2005,02,26)
else
.....


Hope it helps.




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Since you're using MS Access, consider creating a period table in Access, such as:

monthname Start Date End Date
February 2004 1/30/2004 2/25/2004
February 2005 1/30/2005 2/25/2005
February 2006 1/30/2006 2/25/2006

You could populate it using code, and then you could populate a parameter from the monthname field, and then use the dates to filter data accordingly.

I have an example for SQL Server in the formulas FAQ area.

-k
 
Turkbear & Synapsvampire

phenomenal responses - both work great. Its guys like you that make this site awesome.

thx again
Z.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top