How can I run a SQL query to get the unique visitors in a certain time?

Hi I just want to check how can I query this result on SQL?


I checked on this link for the SQL query to select all visits and actions (during a certain time period)

And I tried COUNT(Distinct matomo_log_visit.idvisitor) but it has a different value from the matomo dashboard.

1 Like

Nevermind. I got this already. It is due to the timezone difference

1 Like

Hi @jrc
Thanks for asking about this! We’ve now added this to our FAQ:
How do I write SQL queries to select visitors, list of pageviews, searches, events in the Matomo database

(With a note to account for your websites timezone)

1 Like