Query - Notes in Time Entries
search cancel

Query - Notes in Time Entries

book

Article ID: 252042

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

Is there a way to find how many notes are present against a time entry record, from the DB?

Resolution

The following query can be used in the PPM Schema.

SELECT
    COUNT(*),
    prt.prid
FROM
    prnote prn
    JOIN prtimeentry prt ON prt.prid = prn.prrecordid
GROUP BY
    prt.prid
ORDER BY COUNT(*) DESC;

If DWH is being used, the following query can be used in the DWH Schema.

SELECT
    COUNT(*) cnt,
    timeentry_key
FROM
    dwh_tme_entry_note
GROUP BY
    timeentry_key
ORDER BY COUNT(*) DESC;