Counting DQL

queries to count

Number of documents created:
select datetostring(r_creation_date,’mm-dd-yyyy’) as creation_date, count(*) as document_count, r_object_type from dm_document where r_creation_date >=DATE(TODAY)-7 group by datetostring(r_creation_date,’mm-dd-yyyy’), r_object_type

Number of folders created:
select datetostring(r_creation_date,’mm-dd-yyyy’) as creation_date, count(*) as folder_count from dm_folder where r_creation_date >=DATE(TODAY)-7 group by datetostring(r_creation_date,’mm-dd-yyyy’)

Number of workflows created:
select datetostring(r_start_date,’mm-dd-yyyy’) as wf_start_date, count(*) as workflow_count from dm_workflow where r_start_date >=DATE(TODAY)-7 group by datetostring(r_start_date,’mm-dd-yyyy’)

Number of queue items (inbox) created:
select datetostring(date_sent,’mm-dd-yyyy’) as inbox_queueitem_date, count(*) as dmiqueue_count from dmi_queue_item where date_sent >=DATE(TODAY)-7 group by datetostring(date_sent,’mm-dd-yyyy’)

Number of dm_usage created:
select feature_name, datetostring(latest_use,’mm-dd-yyyy’) as last_login, count(*) as usage_count from dm_usage_log where latest_use >= DATE(TODAY)-3 group by datetostring(latest_use,’mm-dd-yyyy’), feature_name

Leave a Reply

Your email address will not be published. Required fields are marked *