This SQL script calculates the total number of active documents in the FileBound system. It queries the Documents table and filters out any records where the Status field is 0
, which represents deleted documents.
COUNT(DocumentID)
: Counts the total number of document records.DISTINCT
: Counts distinctDocumentID
.WHERE Status <> 0
: Ensures that only active documents (i.e. not deleted) are included in the count.
The result is returned as ActiveDocumentCount, representing the number of documents considered active based on the Status field.
SELECT distinct count(DocumentID) AS ActiveDocumentCount
FROM Documents
WHERE Status <> 0;
Documents Status Value Meanings
0 = Deleted
1 = Active
2 = Archived
3 = Scanned
-2 = Revision
4 = EformGenerated
5 = Unindexed
500 = Indexing_Queued
509 = Indexing_QueuedError
510 = Indexing_OCR
519 = Indexing_OCRError
520 = Indexing_TemplateMatch
529 = Indexing_TemplateMatchError
590 = Indexing_Manual
599 = Indexing_Error
7 = Recycled
700 = Recycle_Processing
800 = QualityControl