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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Parameter Start not more than 6 months

Status
Not open for further replies.

porsche2k7

Programmer
Aug 29, 2007
35
0
0
US
Hi All,

I am trying to figure out a way to create a date parameter where the value which the user selects cannot be more than last 6 months. OR
Is there any way I can restrict the user to select the date value to previous 6 months for the date parameter.

Can we accomplish this without using Business Views?

Thank you.


 
Add this to select statement, wrapped in () so can be used with other clauses.

Code:
(If {?dateparam} < dateadd("m", -6, date(year(currentdate), month(currentdate), 1))
then {datefield} >=  dateadd("m", -6, date(year(currentdate), month(currentdate), 1))
else
{datefield} >= {?dateparam})

Ian
 
Thanks Ian. My report is based on SQL command which is something like below.

Select product, network, sum(duration) from event_table where event_date between {?BeginDate} and {?EndDate} group by product, network

Since parameters BeginDate & EndDate are Dates, the calendar shows up to select the dates. I need to restrict the calendar to not show dates more than last 6 months. I can set a start value in the date prompts properties which will restrict the user to enter a date after the start value. However, that would not be dynamic.

I can't use the formula you suggested in the report select expert since I do not have the event_date in the select statement due to grouping. Please let me know if you need more info. Thank you.
 
Sorry misunderstood your question. I do not know of any way to restrict Calendar.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top