I have a report that is very simple but when it runs, it seems to be filtering through more records than what it should. I have 4 tables, a users table, a points_history table, a location table, and a region table. They are linked as follows:
SELECT users.uid, users.name, points.award_date, points.points, points.type, points.payable, location.desc, region.desc
FROM users
INNER JOIN points
on users.uid = points.uid
LEFT JOIN location
on users.locationid = location.locationid
LEFT JOIN region
on users.regionid = region.regionid
WHERE user.status = 1
AND points.payable = 1
AND region.regionid <> 2
Simple query, but when I generate the report, in the bottom right corner, it displays the number of records "out of" another number of records. In the end, I get 1,434 of 35,000. Why is crystal filtering through the extra records when I have an inner join on the history table. I only want the records from the history table for active users (users.status = 1).
The other two tables are a left join in case the users locationid is null.
Any help would be appreciated. Thanks.
SELECT users.uid, users.name, points.award_date, points.points, points.type, points.payable, location.desc, region.desc
FROM users
INNER JOIN points
on users.uid = points.uid
LEFT JOIN location
on users.locationid = location.locationid
LEFT JOIN region
on users.regionid = region.regionid
WHERE user.status = 1
AND points.payable = 1
AND region.regionid <> 2
Simple query, but when I generate the report, in the bottom right corner, it displays the number of records "out of" another number of records. In the end, I get 1,434 of 35,000. Why is crystal filtering through the extra records when I have an inner join on the history table. I only want the records from the history table for active users (users.status = 1).
The other two tables are a left join in case the users locationid is null.
Any help would be appreciated. Thanks.