Created
May 6, 2017 21:51
-
-
Save stphnwlkr/c025467bba099567c8b401b4f48e84d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remote any function getClosedICount() returnformat="plain" { | |
var cic = queryExecute("SELECT COUNT(*) as qty | |
FROM dbo.View_Request WITH (nolock) | |
Where left(ref_num,1) ='I' AND close_date IS NOT NULL",{},{}); | |
return NumberFormat(cic.qty,','); | |
} | |
remote any function getAverageAgeClosedI() returnformat="plain" { | |
var ai = queryExecute("SELECT AVG(DATEDIFF(d, CONVERT(VARCHAR(12), DATEADD(s, open_date, '19700101'), 107), | |
CONVERT(VARCHAR(12), DATEADD(s, close_date, '19700101'), 107))) AS avgAge | |
FROM dbo.View_REQUEST | |
WHERE left(ref_num,1) ='I' AND close_date IS NOT NULL",{},{}); | |
iavg = '#ai.avgAge# Days'; | |
return iavg; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment