Category=Status
Name=Show Potential Indexing Candidates
Description=Show documents with images but without full indexing data
Heading=Show documents with images but without full indexing data
SQL=		\
	select	\
		DOCUMENTID, 	\
		PageCount, \
		ImageCount, 	\
		PagesIndexed,	\
		AssignedTo	\
	FROM \
		(SELECT h.*, \
			(SELECT COUNT(1) FROM PAGE                          d WHERE d.DOCUMENTID = h.DOCUMENTID) PageCount, 	\
			(SELECT COUNT(1) FROM SURROGATEIMAGE                d WHERE d.DOCUMENTID = h.DOCUMENTID) ImageCount,	\
			(SELECT COUNT(DISTINCT PAGEID) FROM BIBLICALCONTENT d WHERE d.DOCUMENTID = h.DOCUMENTID) PagesIndexed,	\
			(SELECT min(ASSIGNEDTO) FROM TASK                   d WHERE d.OBJECTID = h.DOCUMENTID and TASKTYPEID=2) AssignedTo	\
			 FROM DOCUMENT h	\
			 WHERE EXISTS (	\
				 SELECT 'x'	\
					 FROM SURROGATEIMAGE d	\
					 WHERE d.DOCUMENTID = h.DOCUMENTID	\
			)	\
		) h2	\
		 WHERE PagesIndexed < PageCount	\
 		 order by DOCUMENTID

