Better handling of query table recordcount