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

Counting Null Fields Using Variable

Status
Not open for further replies.

Mav3000

Technical User
Jun 20, 2005
113
GB
Hi, I have 28 numeric fields. I wish to count the amount of null fields for each row in the details section.

I can't for the life of me get the formula to work - and my knowledge is sketchy. This is what I've got so far:

// Total Categories Containing Scores

numberVar CategoryCount := 0;

if isnull({@SS01 Number}) = false then CategoryCount := CategoryCount + 1;
if isnull({@SS02 Number}) = false then CategoryCount := CategoryCount + 1;
if isnull({@SS03 Number}) = false then CategoryCount := CategoryCount + 1;

//etc...

// Return Category Count

Categories;

- Currently, I get an error saying that 'Categories;' does not seem to be part of the formula.

Where am I going wrong?!

Thanks, Mav3000
 
Because you have not declared it.

What is it meant to be in relation to rest of formula? If you want to see value of categorycount then use that at the end of the formula.

Ian
 
Argh! I changed the variable name but didn't change it when I returned it.

I've corrected it and it now works (what a surprise!)

Couldn't see the wood for the trees.

Thanks for the feedback Ian.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top