Talk:ad-hoc contributed reports: Difference between revisions
From MoodleDocs
(Created page with "There are some scripts here that are only usable in 1.9 and have 2.x versions working, so I am removing them. ~Randy") |
Klaus Steitz (talk | contribs) (pqSQL-Query für Distinct user logins per month) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
Could someone apply my latest changes on 2.7 and 2.6 versions? --[[User:Séverin Terrier|Séverin Terrier]] ([[User talk:Séverin Terrier|talk]]) 17:50, 3 December 2014 (AWST) | |||
==Reply to Séverin== | |||
I have copied your changes to 2.7 and 2.6 (I think I have got the right bits; let me know if not) However, just to point out that as a rule we only update the latest version and the one before that -- - so normally it would just be 2.8 and 2.7 - but I did 2.6 anyway :) --[[User:Mary Cooch|Mary Cooch]] ([[User talk:Mary Cooch|talk]]) 17:55, 3 December 2014 (AWST) | |||
:Thanks Mary. There was also another change : a new query. I've just put it myself in 2.7 and 2.6. I know the general rule, but i feel it's a problem, because it means that we sometimes let incorrect information, and people can come to some documentation pages in a specific version from a Moodle internal documentation link, a Google search... And they don't always have the reflex to look at the pages for the most recent version. In fact, if i was using 2.5, i really won't look for 2.8 version ! --[[User:Séverin Terrier|Séverin Terrier]] ([[User talk:Séverin Terrier|talk]]) 21:58, 4 December 2014 (AWST) | |||
==Distinct user logins per month (pg-Version)== | |||
The SQL-syntax for PostgreSQL works a little different, here the query working with pgSQL: | |||
<syntaxhighlight lang="php"> | |||
SELECT | |||
COUNT(DISTINCT l.userid) AS "DistinctUserLogins", | |||
TO_CHAR(TO_TIMESTAMP(l.timecreated), 'Month') AS "Month" | |||
FROM mdl_logstore_standard_log l | |||
WHERE l.action = 'loggedin' AND EXTRACT(YEAR FROM TO_TIMESTAMP(l.timecreated)) = 2023 | |||
GROUP BY EXTRACT(MONTH FROM TO_TIMESTAMP(l.timecreated)), TO_CHAR(TO_TIMESTAMP(l.timecreated), 'Month');</syntaxhighlight> | |||
--[[User:Klaus Steitz|Klaus Steitz]] ([[User talk:Klaus Steitz|talk]]) 08:20, 19 July 2023 (UTC) |
Latest revision as of 08:20, 19 July 2023
Could someone apply my latest changes on 2.7 and 2.6 versions? --Séverin Terrier (talk) 17:50, 3 December 2014 (AWST)
Reply to Séverin
I have copied your changes to 2.7 and 2.6 (I think I have got the right bits; let me know if not) However, just to point out that as a rule we only update the latest version and the one before that -- - so normally it would just be 2.8 and 2.7 - but I did 2.6 anyway :) --Mary Cooch (talk) 17:55, 3 December 2014 (AWST)
- Thanks Mary. There was also another change : a new query. I've just put it myself in 2.7 and 2.6. I know the general rule, but i feel it's a problem, because it means that we sometimes let incorrect information, and people can come to some documentation pages in a specific version from a Moodle internal documentation link, a Google search... And they don't always have the reflex to look at the pages for the most recent version. In fact, if i was using 2.5, i really won't look for 2.8 version ! --Séverin Terrier (talk) 21:58, 4 December 2014 (AWST)
Distinct user logins per month (pg-Version)
The SQL-syntax for PostgreSQL works a little different, here the query working with pgSQL:
SELECT
COUNT(DISTINCT l.userid) AS "DistinctUserLogins",
TO_CHAR(TO_TIMESTAMP(l.timecreated), 'Month') AS "Month"
FROM mdl_logstore_standard_log l
WHERE l.action = 'loggedin' AND EXTRACT(YEAR FROM TO_TIMESTAMP(l.timecreated)) = 2023
GROUP BY EXTRACT(MONTH FROM TO_TIMESTAMP(l.timecreated)), TO_CHAR(TO_TIMESTAMP(l.timecreated), 'Month');
--Klaus Steitz (talk) 08:20, 19 July 2023 (UTC)