> For the complete documentation index, see [llms.txt](https://enterprise-docs.datacamp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enterprise-docs.datacamp.com/integrating-our-data-into-your-tools-via-data-connector-2.0/queries-to-recreate-key-reports-in-the-groups-tab/reporting-section/time-in-learn.md).

# Time in Learn

<figure><img src="/files/zwuJaUSGYo7mCOZjsG6Q" alt=""><figcaption></figcaption></figure>

To replicate the Time spent per month in all content types chart, you can use the following query:

```sql
SELECT
    date_trunc('month', occurred_at) as month,
    course_variant_id, 
    if(sum(duration_engaged) = 0, 0, sum(duration_engaged) / 3600) AS total_hours_on_learn
FROM data_connector_1234.fact_learn_events
-- The chart includes the current month and 11 months before
WHERE date(occurred_at) between
    date_trunc('month', date_add('month', -11, current_date)) and current_date
GROUP BY 1,2
ORDER BY 1,2

```
