Client is using basic SmartList - Employee Summary. Every employee that had wages for all months in the year is duplicated, those that worked part of the year are showing one line. How can I get the duplicated lines not to show in the results?
Dear,
When I checked on the view which created for this Smartlist, I saw it might have the duplicated row if the employees have multiple records in the table UPR00901. You can fix by added the keyword 'DISTINCT' right after the 'Select' or in the JOIN CLAUSE of the first table, added 1more condition into the JOIN CLAUSE (I pasted my script there and remove the detail because it's so long, just keep the modify points there).
SELECT DISTINCT RTRIM(dbo.UPR00100.EMPLCLAS) AS EMPLCLAS, .....
FROM dbo.UPR00900 WITH (NOLOCK) LEFT OUTER JOIN
dbo.UPR00901 WITH (NOLOCK) ON dbo.UPR00900.EMPLOYID = dbo.UPR00901.EMPLOYID AND dbo.UPR00900.YEAR1 = dbo.UPR00901.YEAR1 INNER JOIN
dbo.UPR00100 WITH (NOLOCK) ON dbo.UPR00900.EMPLOYID = dbo.UPR00100.EMPLOYID INNER JOIN
dbo.UPR00300 WITH (NOLOCK) ON dbo.UPR00900.EMPLOYID = dbo.UPR00300.EMPLOYID
Hope this can help for you!
Best Regards,
John Nguyen
My thoughts are that the Employee Summary report in SmartList, is just pulling from the Employee Summary view in the company database.
If you run a SELECT script with this 'Employee Summary' view in SQL, against this same company database, do you also see the duplicated records, or no?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156