Dears
I am asked to produce a report that shows the following values for a certain user.
1. Number of Recieved Tasks
2. Number of Approved Tasks
3.Number of Rejected Tasks
4.Number of Tasks In progress
5.Average Time Required to process Tasks.
I searched the K2ServerLog database for these values and come up with these SQL statements ... i want to make sure that all of them is correct, if not the can you supply the correct ones.
1. select count(*) from dbo._Worklist INNER JOIN K2ServerLog.dbo._ProcInst ON (_Worklist.ProcInstID = _ProcInst.ID) where dbo._Worklist.[Destination]='K2:DomainDomainUser' and _Worklist.Status=0 and (_ProcInst.[Status] between 1 and 3) order by ProcInstID
2. Select count(distinct(K2ServerLog.dbo._ActInstSlot.ProcInstID)) FROM K2ServerLog.dbo._ActInstSlot INNER JOIN K2ServerLog.dbo._ProcInst ON (_ActInstSlot.ProcInstID = _ProcInst.ID) where _ActInstSlot.[User]='K2:DomainDomainUser' and _ActInstSlot.FinalAction='Approve' and K2ServerLog.dbo._ProcInst.[Status]=3
3. Select count(distinct(K2ServerLog.dbo._ActInstSlot.ProcInstID)) FROM K2ServerLog.dbo._ActInstSlot INNER JOIN K2ServerLog.dbo._ProcInst ON (_ActInstSlot.ProcInstID = _ProcInst.ID) where _ActInstSlot.[User]='K2:DomainDomainUser' and _ActInstSlot.FinalAction='Reject' and K2ServerLog.dbo._ProcInst.[Status]=3
4. Select count(distinct(K2ServerLog.dbo._ActInstSlot.ProcInstID)) FROM K2ServerLog.dbo._ActInstSlot INNER JOIN K2ServerLog.dbo._ProcInst ON (_ActInstSlot.ProcInstID = _ProcInst.ID) where _ActInstSlot.[User]='K2:domaindomainUser' and (K2ServerLog.dbo._ProcInst.[Status]=2 or K2ServerLog.dbo._ProcInst.[Status]=1)
5. I couldnt find a good sql query for that
If you think any of these is correct then please supply a correct one