# Extract audit details (time committed) in AQL? **Category:** [Platform](https://discourse.openehr.org/c/platform-implem/7) **Created:** 2023-01-06 21:54 UTC **Views:** 511 **Replies:** 2 **URL:** https://discourse.openehr.org/t/extract-audit-details-time-committed-in-aql/3435 --- ## Post #1 by @chaya Hi, We want to store the time the composition is stored in the CDR (ehrBase). Is it possible to store and extract the audit details class which stores this information in `time_committed` . If so can you please provide the flat json and the aql for the same. Note, we do not want to store the composition commit time in c/context/start_time. This is reserved to store the time of encounter. Any guidance will help. Thanks --- ## Post #2 by @ian.mcnicoll On Better CDR you can do ``` SELECT c/name/value as compName, vo/uid/value as identifier, v/uid/value as versionId, v/preceding_version_uid/value as previousVersionId FROM EHR e CONTAINS VERSIONED_OBJECT vo CONTAINS VERSION v[all_versions] CONTAINS COMPOSITION c ORDER BY identifier ASC, v/commit_audit/time_created/value DESC ``` I'm not sure if this is supported in Ehrbase or other CDRs. --- ## Post #3 by @ian.mcnicoll Also see https://discourse.openehr.org/t/aql-query-for-compositions-that-have-been-created-updated-within-a-time-period/2458 --- **Canonical:** https://discourse.openehr.org/t/extract-audit-details-time-committed-in-aql/3435 **Original content:** https://discourse.openehr.org/t/extract-audit-details-time-committed-in-aql/3435