I am using Crystal 8.5 and I want to return deduction codes and values from Active employees who did not get paid. Here is my SQL that I have started:
SELECT dbo.EBase.EbFirstName, dbo.EBase.EbMiddleName, dbo.EBase.EbLastName, dbo.EBase.EbSocNumber, dbo.EDeduct.DeeFlxIDDed,
dbo.EDeduct.DeeAmount, dbo.EJob.EjLocation, dbo.EPayrollBase.PrbPayPeriod, dbo.CheckSumm.CsuFlxIDEb
FROM dbo.EBase INNER JOIN
dbo.EDeduct ON dbo.EDeduct.DeeFlxIDEb = dbo.EBase.EbFlxID INNER JOIN
dbo.EJob ON dbo.EJob.EjFlxIDEb = dbo.EBase.EbFlxID INNER JOIN
dbo.EPayrollBase ON dbo.EBase.EbFlxID = dbo.EPayrollBase.PrbFlxIDEb LEFT OUTER JOIN
dbo.CheckSumm ON dbo.CheckSumm.CsuFlxIDEb = dbo.EBase.EbFlxID
WHERE (dbo.EDeduct.DeeFlxIDDed = '50052' OR
dbo.EDeduct.DeeFlxIDDed = '50046' OR
dbo.EDeduct.DeeFlxIDDed = '74201' OR
dbo.EDeduct.DeeFlxIDDed = '74203' OR
dbo.EDeduct.DeeFlxIDDed = '50050' OR
dbo.EDeduct.DeeFlxIDDed = '50032') AND (dbo.EJob.EjLocation = '0815') AND (dbo.EPayrollBase.PrbPayPeriod = '2008010')
ORDER BY dbo.EBase.EbLastName
My From Statment must be hosed because this is returning everyone with a check. Can anyone help
SELECT dbo.EBase.EbFirstName, dbo.EBase.EbMiddleName, dbo.EBase.EbLastName, dbo.EBase.EbSocNumber, dbo.EDeduct.DeeFlxIDDed,
dbo.EDeduct.DeeAmount, dbo.EJob.EjLocation, dbo.EPayrollBase.PrbPayPeriod, dbo.CheckSumm.CsuFlxIDEb
FROM dbo.EBase INNER JOIN
dbo.EDeduct ON dbo.EDeduct.DeeFlxIDEb = dbo.EBase.EbFlxID INNER JOIN
dbo.EJob ON dbo.EJob.EjFlxIDEb = dbo.EBase.EbFlxID INNER JOIN
dbo.EPayrollBase ON dbo.EBase.EbFlxID = dbo.EPayrollBase.PrbFlxIDEb LEFT OUTER JOIN
dbo.CheckSumm ON dbo.CheckSumm.CsuFlxIDEb = dbo.EBase.EbFlxID
WHERE (dbo.EDeduct.DeeFlxIDDed = '50052' OR
dbo.EDeduct.DeeFlxIDDed = '50046' OR
dbo.EDeduct.DeeFlxIDDed = '74201' OR
dbo.EDeduct.DeeFlxIDDed = '74203' OR
dbo.EDeduct.DeeFlxIDDed = '50050' OR
dbo.EDeduct.DeeFlxIDDed = '50032') AND (dbo.EJob.EjLocation = '0815') AND (dbo.EPayrollBase.PrbPayPeriod = '2008010')
ORDER BY dbo.EBase.EbLastName
My From Statment must be hosed because this is returning everyone with a check. Can anyone help