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

limit the date range selected

Status
Not open for further replies.

retygh45

IS-IT--Management
May 23, 2006
166
US
Using CR11:

I have a SQL database I'm reporting off and the data in this db is always 1 day behind the live production data. So my reports prompt the user for a date range, and they use the crystal calendar function and choose say monday-friday, but the data is only going to contain monday-thursday because it's a day behind, and then they get all confused because there's 1 less day's worth of data and they don't know why.

Is there any way to limit the date parameter's maximum date to be yesterday's date? (Currentdate-1) so that they cannot select a date past this date?

Any help is greatly appreciated, thanks!
 
Im not aware of a way to do that but if your report always runs from the start date the user inputs through the most current information in the DB, then only ask the user for the start date. in your paramter list instead of the field date={?parameterdate} use field date >= {?startdate}.

I dont see that this would eliminate a user asking why there is no information for the current date though. Perhaps a text field in your header poiting out the exact dates the report will output data for? That would be assuming the readers of your report actually read that part....

_____________________________________
Not the brightest
Crystal Reports XI Developer Version
user in the world........
 
You could have a section in the report header that prints a large-font message saying "Today's data is not yet available to this report". Have it suppressed if the end of the date range is yesterday or before.

You could even combine this with something likea 'divide by zero' that will stop the run.

Where I work, the data is refreshed each evening, except at weekends and there are occasional delays. Also some datasets are refreshed only weekly or monthly. The database has been given a special record that holds the date of the latest load, and this can be displayed.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
If you are using crystal XI, make it a dynamic parameter, and tie it to the values of the database field without allowing manual input. Then they will not be able to pick the data that doesn't exist in the database anyway.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Ok, thanks everyone for the resposnses. For now, I'll just make a section in the header alerting them to the fact that it doesn't contain today's date.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top