Created
January 14, 2010 19:06
-
-
Save ebot/277397 to your computer and use it in GitHub Desktop.
Common EDM Queries
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
SELECT YEAR(ModifyDateTime) as document_year, | |
COUNT(TotalKB) as document_count, | |
(SUM(TotalKB)/1024)/1024 as document_size_gb | |
FROM Documents as d | |
INNER JOIN DocTypes as dt ON d.DocType = dt.DocType | |
INNER JOIN DocArchStg as das ON d.DocID = das.Docid | |
INNER JOIN DocsOwners as do ON d.DocId = do.DocId | |
INNER JOIN Encounters as e ON do.OwnerId = e.EncntrOwnerId | |
GROUP BY YEAR(ModifyDateTime) WITH ROLLUP |
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
SELECT YEAR(ModifyDateTime) as document_year, | |
COUNT(TotalKB) as document_count, | |
(SUM(TotalKB)/1024)/1024 as document_size_gb | |
FROM Documents as d | |
INNER JOIN DocTypes as dt ON d.DocType = dt.DocType | |
INNER JOIN DocArchStg as das ON d.DocID = das.Docid | |
WHERE dt.DocTypeName in ('PT-PAY', 'RABLUEP', 'RACAIDP', 'RACAREP', 'RAUHC', | |
'WORKCOMP', 'ZEROPAYS', 'RAAGENCY', 'EMPHLTH', | |
'DISCINS', 'NONDISC') | |
GROUP BY YEAR(ModifyDateTime) WITH ROLLUP |
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
SELECT DISTINCT DocTypeName, d.DocId, DocDateTime, CreateDateTime, | |
ModifyDateTime, DocTypeDesc, OwnerId | |
FROM DocTypes as dt | |
INNER JOIN Documents as d ON dt.DocType = d.DocType | |
INNER JOIN Objects as o ON d.DocId = o.DocId | |
INNER JOIN FileFormats as ff ON o.FileFmtId = ff.FileFmtId | |
INNER JOIN DocsOwners as do ON d.DocId = do.DocId | |
INNER JOIN Encounters as e ON do.OwnerId = e.EncntrOwnerId | |
WHERE Year(ModifyDateTime) = '2007' |
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
SELECT DISTINCT DocTypeName, d.DocId, DocDateTime, CreateDateTime, | |
ModifyDateTime, DocTypeDesc, OwnerId | |
FROM DocTypes as dt | |
INNER JOIN Documents as d ON dt.DocType = d.DocType | |
INNER JOIN Objects as o ON d.DocId = o.DocId | |
INNER JOIN FileFormats as ff ON o.FileFmtId = ff.FileFmtId | |
INNER JOIN DocsOwners as do ON d.DocId = do.DocId | |
WHERE dt.DocTypeName in ('PT-PAY', 'RABLUEP', 'RACAIDP', 'RACAREP', 'RAUHC', | |
'WORKCOMP', 'ZEROPAYS', 'RAAGENCY', 'EMPHLTH', | |
'DISCINS', 'NONDISC') | |
AND Year(ModifyDateTime) = '2007' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment