Follow

Queries for coresuite time

List of time account changes by employee, date and time account

DECLARE @untilDate AS DATETIME SET @untilDate='20130101'
SELECT
T1.U_Name AS [Employee]
,T0.U_Date AS [Date]
,T2.U_Name AS [TimeAccount]
,SUM(T0.U_ChangeValueD) AS [ChangeValue]
FROM [@SWA_CT_WTM_TA_WTD] T0
INNER JOIN [@SWA_CT_RESS] T1
    ON T1.Code=T0.U_ResourceCode
INNER JOIN [@SWA_CT_WTM_TIMEACC] T2
    ON T2.Code=T0.U_TaCode
WHERE T0.U_DeletedF<>'Y'
AND T1.U_DeletedF<>'Y'
AND T2.U_DeletedF<>'Y'
AND T1.U_Status='OPN'
AND T0.U_Date<=@untilDate

GROUP BY T1.U_Name
,T1.Code
,T0.U_Date
,T2.U_Name

ORDER BY T0.U_Date
,T1.U_Name
,T2.U_Name

List of all expenses linked to an object (e.g. service call)

DECLARE @objectType AS VARCHAR(10) SET @objectType='191' /*service call*/
DECLARE @objectEntry AS VARCHAR(10) SET @objectEntry='4751' /*call id*/
SELECT
T0.*
FROM [@SWA_CT_EFFCHARGES] T0
INNER JOIN [@SWA_CT_EFFORT] T1
    ON T0.U_EffortCode=T1.Code
WHERE T0.U_DeletedF<>'Y'
AND T1.U_DeletedF<>'Y'
AND T1.U_ObjType=@objectType
AND T1.U_ObjEntry=@objectEntry
Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.