Viewing 3 posts - 1 through 4 (of 4 total)
dwain.c is correct that once you have a Rep table, you should really capture the HireDate and TerminationDate.
Then all you need to do is correct the Rep table WHERE clause...
February 24, 2015 at 10:21 am
#1779668
From a data integrity standpoint you should REALLY have a Rep table.
Glad to hear you got it working.
Good Luck.
February 23, 2015 at 1:13 pm
#1779399
Assuming you have a Rep table that lists all active reps.
SELECT r.RepCode,
IsNull((Select SUM(s.SO_Amount)
FROM SO_Table so
WHERE so.RepCode = r.RepCode
AND...
February 23, 2015 at 11:31 am
#1779359