Requests pending number difference between "List of Approvers with Number of Requests Pending" and the "Approve/Reject" tab

Requests pending number difference between "List of Approvers with Number of Requests Pending" and the "Approve/Reject" tab

Customers may observers different pending number in the classic SQL report for List of Approvers with Number of Requests Pending and in the Approve/Reject tab.

The Approve/Reject tab is the right place to check the number of requests currently pending with a specific Approver, as it displays the records only if the logged in person is the current approver.

Where as report for List of Approvers with Number of Requests Pending display all the requests even though if the approver is not the current approver.

below are the queries involved in fetching the data:
1) Approve/Reject tab:

SELECT DISTINCT TOP 500 NULL SmartUninstalled, vMyRequestsCatalog.*, ap.QuestionTemplateID_FK, ap.QuestionsAnswered
FROM vMyRequestsCatalog INNER JOIN WD_ApprovalProcess ap ON ap.RequestID_FK = RequestID
AND ap.ADGUID = '92c0e9709100a841a6e7e1d2d26c45c7' AND ap.IsCurrentApprover = 1 AND ap.Processed = 0
WHERE (Authorized <> 1) AND vMyRequestsCatalog.Cancelled = 0
AND [DateTime] BETWEEN '<start time>' AND '<end time>' ORDER BY DateTime DESC

2) Report for "List of Approvers with Number of Requests Pending" :

select p.UniqueUserName,count(p.UniqueUserName) AS [Requests Pending] from wd_ApprovalProcess ap INNER join wd_Packagerequests pr
on ap.requestid_fk = pr.requestid INNER join wD_profile p on ap.ADGUID = p.ADGUID
where pr.authorized = 0 group by p.UniqueUserName
Labels (1)
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jun 18, 2020 01:06 AM
Updated by:
Contributors