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

Record count

Status
Not open for further replies.

be1s

Programmer
Dec 8, 2003
59
0
0
US
I have a stored procedure attached to a crystal report.
Is there a way to check the record count when the report is ran? In other words, I'd like to check if the record count = 0 if the stored procedure returned no records.

Thanks!
 
Hi,
Not to be a smart-a__, but would not the lack of records displayed give you some idea?

You can place a text box on the report with a
'No Records Returned'
message and supress it if recordcount is > 1




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,
OOPS.Bad fingers.I meant to type 'If recordcount > 0'




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Turkbear,

Thank you for your reply.

Yes, the lack of records displayed would be an indication that there no records. However, for the end user some kind of message to say so would be nice. Which leads me to the second part of your reply...

Recordcount > 0??? Seems to me that if it returns a count > than 0 then there are records.
 
Turkbear to to SUPPRESS the message if the count was > 0. That makes perfect sense to me.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Ok. That makes sense to me too.

Thanks.
 
RecordNumber will return a value of 1 even when no records are returned by the SP.

One way to accomplish this is to create a text object 'No records returned' and add a conditional suppression formula to test fagainst a filed which would always have data i.e.

Not IsNull({MyTable.Field})

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Gary,

Are you suggesting that in my stored procedure, if there are no records returned, I should insert a dummy record in my temp table and check against a field for a null value in Crystal Report?
 
No you don't need to change your SP in any way, If no records are returned to CR from teh SP then all of the database field values in CR will be null.

Test against one of these to check if records have been returned or not.

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top