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!

Prompt For Each Parameter/ set minimum date range 2

Status
Not open for further replies.

dz0k52

Technical User
Jul 21, 2003
32
0
0
CA
Hi I somewhat of a newbie so I'll do my best to include the right info. I am creating a report in Crystal 8 for Maximo 4.1.1 (Oracle 8i datbase)to show me all the PM's due by department in a given period of time. I have two parameter fields, one asking for department and the next asking for date range. If I select a department then hit okay (forgetting to select next parameter which is date) I get everything due from today to today which obviously is nothing. what I would like to do is after I select the department, if I forget to select the next parameter (date), I would like to get a prompt to select the date. Is this possible?? I would also like to set the default minimum date range to 7 days after sysdate (now) is this possible???
 
Make sure you don't have a default value in the date parameter. Crystal shouldn't let you run the report if your are missing any.
 
Not sure how to do that. When I go into the "Edit Parameter Field" option then into "Set Default Values", the default values window is empty.In the options box at the bottom, the start and end date of the report are both sysdate (now)and are greyed out. I don't want to limit the range either.Is there somewhere else where I can change the defaults??
 
You could accomplish this by creating two parameters in order to define the date range. Create {?begindate} as a discrete value date parameter--the current date will be the automatic default. Then create
{?numberofdays} as a discrete value number parameter and click on set default and enter "7" (no quotes) as the value.

For your record selection formula use something like:

(
{table.dept} = "All" or
{table.dept} = {?dept}
) and
{table.date} in {?begindate} to {?begindate} + {?numberofdays}

If you entered no parameter values, the report would return all departments for the period today through a week from today. If you really mean you want a week period, you would use a "6" instead.

-LB
 
Thank You,
It work great except I can't get the default department to be all departments if none is chosen. It takes the top value of the default parameter list. I need a value list to choose from because the department numbering system is a little complex. Also can my date range selection (enddate) be another date field instead of a number value but still default a set number of days from the begindate?
 
I make the top value "All", that's the default if nothing is chosen.

-k
 

Below is the selection formula I used. The top value in my default departments (equipment.locations) is All. I still get no results if I select nothing (not recognizing All?).
{EQUIPMENT.LOCATION} = "All" or {EQUIPMENT.LOCATION} = {?department} and {PM.NEXTDATE} in {?begindate} to {?begindate} + {?numberofdays}
 
Try this as your record selection formula:

if {?department} = "All" then
{PM.NEXTDATE} in {?begindate} to {?begindate} + {?numberofdays}
else
{EQUIPMENT.LOCATION} = {?department} and {PM.NEXTDATE} in {?begindate} to {?begindate} + {?numberofdays}

-dave
 
That worked great.
Thanks guys for your patience with me.
Great site with some great people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top