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

Parameter Fields question

Status
Not open for further replies.

MHann

Technical User
Jun 30, 2008
13
US
Hello,

I have 2 Parameters that came into my report from the database (BegDate & EndDate).
I want to set these dates to default to the current date. While I can create a new parameter set to current date I'm having trouble doing so with these existing parameters.
Any ideas?

Thank you.
 
In parameter editor remove the default dates. When left blank crystal will populate with current date when report is run.

Ian
 
Ian,

Can you explain what version you are using? Are you assuming the parameters are from a stored procedure? I don't recall ever seeing this behavior, so am interested in what cases this might occur.

-LB
 
I'm using version XI. The paramters are forced into the report by an SAP Infoset. Leaving the date blank was not an option it can either be null or there has to be a date.

I was able to cheat it and put the dates as 12/31/9999. This will always pull the data I need. Only problem is it will pull any future data. But we never have data future data going out more than a few days.

It's not preferred but it works.

Thanks!
 
I'm not sure how you are currently using the parameters, but you can always build the currentdate option into the selection formula, like this, for example:

(
(
{?StartDate} = date(9999,12,31) and
{table.date} <= currentdate
) or
(
{?StartDate} <> date(9999,12,31) and
{table.date} >= {?StartDate}
)
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top