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

NULL Values

Status
Not open for further replies.

Soleil525

MIS
Jan 9, 2002
77
US
Hello All,

Is it possible to use a parameter to include or exclude Null values from a report. For example, I have a date field called Termination. If an employee is terminated, then a termination date is entered in this field. Otherwise, the field is empty. I want to allow the user the option of generating report for terminated employees or for active employees. The idea is at runtime the user will see something like this:
{Termination_Date} = ?Termination(parameter Null/not Null)
Can someone please show me how to accomplish this. Your help is greatly appreciated.
Bryan
 
im not sure this is what you want, but you can use "suppress by formula"
go to the fields format on the report, and in the main part click on suppress, and in the formula part:

if({table.field}) =null

i hope this helps.

Eli
 
A parameter has to be of only one Type, so you could either use a string param to answer NULL or a date, or two parameters.

Your selection formula would be (using the one param method)
If {?TermDate}= NULL then
IsNull({table.termdate}
else
{table.termdate} = CDate({?TermDate})

Editor and Publisher of Crystal Clear
 
Thank you for a your respond. I guess my question is not clear enough. I want to use the termination_date field as a filter on a report. If an employee is terminated, a termination date is filled in. Otherwise, the termination_date field is empty. I can hard code these statements in the record selection formula editor: IsNull({termination_date}) to select all the employees that have been terminated or Not IsNull({termination_date}) to select the active employees. What I really need is to use a parameter to allow the user to decide whether they want to see terminated employees or active employees. I hope this make sense.
Thanks,
Bryan
 
Bryan,

Insert, Parameter field, make it have default values of "Terminated" and "Active". Make sure the "allow additinal input" checkbox is not selected. This will make the user choose one of the 2 default values from a drop down listbox.

Then tie your paramter field into your record selection formula.

If {?Parmfield} = "Active" then Not IsNull({TermDate}) else
IsNull({Termdate}) Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
 
Dgillz,

Thank you for your help. I'll try it out.

Bryan
 
My appraoach would be to set up a Parameter called "ReportType"

{?ReportType}
Parameter type: String
Description: Enter "T" to report on terminated employees, "A" for active employees


In the record select compose the following formula

(if uppercase((?ReportType}) = "T" then
isnull({table.termination_date})
else if uppercase((?ReportType}) = "A" then
not isnull({table.termination_date})) and
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top