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!

Default date ranges vs parameter date ranges 3

Status
Not open for further replies.
Jun 16, 2000
199
US
Hello.

I am using Crystal 8 - the web component. I had a request from one of my co-workers that I need some help solving. I have a report that prompts the user to enter starting and ending dates in a report. Is there a way to keep this option but have a default value = to the last 8 weeks (based on current date) appear if nothing is entered for the date parameter?


Thanks for any insight that you can provide.

 
You could have an additional parameter field that says "select last eight weeks?" that offers yes or no.

Then your selection formula could be an if-then-else:

If {?8wks} = 'YES'
then {date} in CurrentDate - 56 to CurrentDate
else {date} in {?Start} to {?End}

Or you could have the Start date be an unused date (like 1/1/1) and use the same logic:

If {?Start} = Date(1,1,1)
then {date} in CurrentDate - 56 to CurrentDate
else {date} in {?Start} to {?End}

Warning, using if then else in the selection formula will usually slow performance. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top