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

Parameter for Last 7 Days

Status
Not open for further replies.

carla

Technical User
Jan 9, 2001
39
US
Hello,

I have an ASP page where the user can select one of the following options from a drop down menu:

"All"
"Records from Last 7 Days"

Depending on what option the user chooses he will see either all support cases or only support cases opened in the Last 7 Days.

I am stuck on how to create a parameter that will accept one of these options and display the correct information. I am using CR8.0. Can anyone point me in the right direction? I've got it working so far with 2 separate reports and a conditional statement in my ASP code, but I really only want to maintain one report.

Thanks for any help!
Carla
 
Carla,

Create a parameter field to prompt for All or Last 7 Days.
Create a formula field that calculates the date seven days ago. In the Select Expert select records if your parameter field value = "all" or the record date >= your formula date field.

Hope this helps.

MrBillSc
 
Create a string paramter with default values of "All" and "Last 7 Days". Then write a record selection formula based on that value as follows:

If {?Parameter}="All" then true else {YourDateField} in CurrentDate to dateadd("d",-7,CurrentDate)

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
dgillz, that worked wonderfully. Thank you.

Thank you both for your responses :eek:)
 
Check the database-Show SQL, note that the SQL isn't being passed to the database, so your performance will be bad.

To correct this, perform a slight modification:

If {?stringtest} <> &quot;All&quot; then {Orders.Order Date} in CurrentDate to dateadd(&quot;d&quot;,-7,CurrentDate)
else
if
{?stringtest} = &quot;All&quot; then
true

I know that it looks weird, but Crystal is weird with pass through SQL, fight fire with fire ;)

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top