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

Value of COUNT when no records in table

Status
Not open for further replies.

behbeh

Programmer
Mar 10, 2001
48
US
Hi!
Does anyone know what is returned by the COUNT function if there are no records in the table? I thought a zero would return but when I place my formula on the report to view the value, it is blank when there are no records in the selection. I have tried the IsNull function and it does not work. I need to print an informational message if there are no records.
Any help would be greatly appreciated!
 
I tried isnull(Count(sdfsdf)) and it worked - is anything else going on in the report Andrew Baines
Chase International
 
I have a shared formula (in a subreport) since I need this shared value in the main report (see below)

WhilePrintingRecords;
Shared NumberVar countTrade := IIf(IsNull(Count ({usp_parm_TradeNames;1.brand_name})),0,Count ({usp_parm_TradeNames;1.brand_name}))

I wanted to force the variable to be numeric since I check the value of countTrade for other 'stuff'in the report.

Is this incorrect?
 
If you use the count function it will return a blank, however if you want a return of a numeric, try using a running total, this will create a 0 if there aren't any records returned.
-Bruce Seagate Certified RCAD Specialist.
-Bruce Thuel-Chassaigne
roadkill150@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top