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

Invalid attempt to read when no data is present

Status
Not open for further replies.

fuzzyocelot

Programmer
Jul 22, 2003
333
US

I'm designing a report using Reporting Services 2000. The data source is based on a stored procedure. There are two data parameters - a start date and end date. If a normal start and end date is provided (such as 4/1/09 and 4/20/09) the proc returns a description and a record count for that period. It works fine in the report.

Here's the problem. If someone specifies a start date that is greater than the end date (such as 4/20/09 as the start date and 4/1/09 as the end date), the procedure returns "bad data". When I run the report, I get a "Invalid attempt to read when no data is present" error. Is there any way to not get that error and display something in the report indicating there is no data or that the date range is incorrect?

Thanks!
 
I would change the stored procedure to check for a valid date and return an invalid messge or "0 count" if it is invalid. Then in SSRS you can look for that and display a message accordingly. Just a thought.
~Brett

--------------------------
Web/.net Programmer & DBA
Central PA
 
Thanks for replying. The stored procedure already checks for bad dates and returns an error message. I'm just not sure how to check for that error message in the report itself.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top