Since you're using GROUP BY, you're not going to get a single result. You're going to get a count of the number of rows in the table each unique 'CUSTNO' has, for each 'CUSTNO' that matches your WHERE clause. Make sense? You're going to need a loop to process that result, assuming that's actually the query you're trying to do. I'm guessing that's not the query you want. I'm guessing you want to leave off the GROUP BY. Then you'll get a single total of the number of rows that match your WHERE clause.
Actually, now that I re-read your post it looks to me like what you want is the number of rows returned by your query, not the SUM itself.
$numberofcustomersmatchingquery = mysql_num_rows($result);