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

String and date parameters in the same report

Status
Not open for further replies.

suefhmis

Instructor
Jan 24, 2002
25
US
I'm using CR 8.5. I've created a report in which the user can search by a name or partial name (a string parameter field). Is it possible to ask the user if he/she also wants to search by date range, and if so, to then pop the date range parameter? If this is not possible, is there any way to prevent default values from appearing in the date range fields of the parameter? Thanks in advance.
 
why don't you preset the date min/max such that they will return all values...ie. set a min = jan 1 1900 and a max = Dec 31, 2099

Then in the parameter instructions, advise the user to change the values only if they want to specify a particular date value Jim Broadbent
 
Unfortunately you cannot conditionally pop parameters, but you can ignore them, and rather than preset and pass them, preset and make the report ignore them if they're the default values.

Here's an example record selection formula that will only use the date parameter when the minimum datetime entered is >= 1930 (you can check for whatever makes sense):

(
if minimum({?DateRange}) >= cdatetime(1930,1,1,0,0,0) then
({NullTester.Date1} >= minimum({?DateRange})
and
{NullTester.Date1} <= maximum({?DateRange}))
else if
minimum({?DateRange}) < cdatetime(1930,1,1,0,0,0) then
true
)


and
// just showing another part of the record selection
{NullTester.Text1} <> &quot;foobar&quot;

Be careful when using date functions against a datetime field, you may get bad results, so compare using the same date types.

The above example is based on using a datetime parameter which uses a range.

-k kai@informeddatadecisions.com
 
Hi..

How are you using the reports? I call the report from another application. I handle these things from the calling application itself.Could ypu please tell me how your enviornment is different from mine..

Regards
Krishna Kumar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top