#_title#
SELECT cho.cho_id AS id, cho.cho_name AS name, ( select top 1 b.batchtime from tbl_EAI_InboundBatches b where b.ownerId = cho.cho_id and b.ownerType = 'CHO' order by b.batchtime desc ) as lastBatchUpdate, ( select count( opr.operatorId ) from tbl_OPR_ClientOperators opr where opr.ownerId = cho.cho_id and opr.fsltablecode = 'CHO' ) as childCount, ( select count( opr.operatorId ) from tbl_OPR_ClientOperators opr inner join tbl_CHO_Operators choA on choA.cho_Id = opr.fsl_choId where opr.ownerId = cho.cho_id and opr.fsltablecode = 'CHO' ) as mappedCount FROM tbl_CHO_Operators cho WHERE 1 = 1 AND cho.cho_type in ( 'O', 'G', 'C' ) AND cho.cho_type = ORDER BY lastBatchUpdate desc, childCount desc, cho.cho_name
Name Last Batch Update Members 1FS Mapped
#name# #dateformat( lastBatchUpdate, 'mm/dd/yyyy' )# #childCount# #mappedCount#