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

How to make default parameter empty

Status
Not open for further replies.

vshapiro

Programmer
Jan 2, 2003
211
US
I have report with four parameters. My record selection formula looks like:

{FACTS_DIM_PROJECT_TYPE_CODE.ACTIVE} = "Y" and
{V_PACS_PROJECT_STATUS.STATUS_CODE} = "02" and
(if {?ProjType} <> &quot;All&quot; then
{FACTS_DIM_PROJECT_TYPE_CODE.PROJECT_TYPE_DESCRIPTION} = {?ProjType}
else if {?ProjType} = &quot;All&quot; then true) and
(if {?Location} <> &quot;All&quot; then
{FACTS_DIM_FIELD_OFFICE.FIELD_OFFICE_DESCRIPTION} = {?Location}
else if {?Location} = &quot;All&quot; then true) and
{PACS_PROJECT.OPEN_DATE} in {?Start_Date} to {?End_Date}

I need to be able leave ?Startt_Date and ?End_Date sometimes blank. Another words - when user wants to select only Location and Project Type and need all the dates.
 
Instead of leaving them blank, consider setting a default to some dat which is out of range for the requirements, such as:

1/1/1960

Then you can test for this date, as in:

(
if {?StartDate} <> cdate(1960,1,1) then
{FACTS_DIM_PROJECT_TYPE_CODE.PROJECT_DATE} >= {?StartDate}
else if {?StartDate} = &quot;All&quot; then
true
)

-k
 
Replace your date selection line with this:

(if {?Start_Date} = currentdate and {?end_date} = currentDate then true else {PACS_PROJECT.OPEN_DATE} in {?Start_Date} to {?End_Date})

Basically if the user does not complete the dates they will default to todays date. If they are both set to today the true condition is evaluated and nothing is restricted on date.

Steve Phillips, Crystal Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top