You are on page 1of 2

SELECT

u.username as 'Rut', u.firstname as 'Nombre', u.lastname as 'Apellidos',


c.shortname as 'Codigo Curso' , c.fullname as 'Curso',
case
when DATE_FORMAT(FROM_UNIXTIME(cp.timecompleted),'%Y-%m-%d') is not null then
'Sí'
when DATE_FORMAT(FROM_UNIXTIME(cp.timecompleted),'%Y-%m-%d') is null then 'No'
end
AS completado
FROM prefix_course_completions AS cp
JOIN prefix_course AS c ON cp.course = c.id
JOIN prefix_user AS u ON cp.userid = u.id
WHERE c.enablecompletion = 1
ORDER BY u.username

SELECT
u.username as 'Rut', u.firstname as 'Nombre', u.lastname as 'Apellidos',
c.shortname as 'Codigo Curso' , c.fullname as 'Curso',
DATE_FORMAT(FROM_UNIXTIME(e.timestart),'%Y-%m-%d') as 'Fecha de Inicio',
case
when DATE_FORMAT(FROM_UNIXTIME(cp.timecompleted),'%Y-%m-%d') is not null then
'Sí'
when DATE_FORMAT(FROM_UNIXTIME(cp.timecompleted),'%Y-%m-%d') is null then 'No'
end
AS completado
FROM prefix_course_completions AS cp
JOIN prefix_course AS c ON cp.course = c.id
JOIN prefix_user AS u ON cp.userid = u.id
JOIN prefix_user_enrolments as e on u.id = e.userid
WHERE c.enablecompletion = 1
ORDER BY u.username

SELECT
u.username as 'Rut', u.firstname as 'Nombre', u.lastname as 'Apellidos',
c.shortname as 'Codigo Curso' , c.fullname as 'Curso',
DATE_FORMAT(FROM_UNIXTIME(u.timecreated),'%Y-%m-%d') as 'Fecha de Matricula1',
DATE_FORMAT(FROM_UNIXTIME(u.timemodified),'%Y-%m-%d') as 'Fecha de Matricula2',
DATE_FORMAT(FROM_UNIXTIME(cp.timecompleted),'%Y-%m-%d') as 'Fecha de Inicio',
case
when DATE_FORMAT(FROM_UNIXTIME(cp.timecompleted),'%Y-%m-%d') is not null then
'Sí'
when DATE_FORMAT(FROM_UNIXTIME(cp.timecompleted),'%Y-%m-%d') is null then 'No'
end
AS completado
FROM prefix_course_completions AS cp
JOIN prefix_course AS c ON cp.course = c.id
JOIN prefix_user AS u ON cp.userid = u.id
WHERE c.enablecompletion = 1
ORDER BY u.username

SELECT
u.username as 'Rut', u.firstname as 'Nombre', u.lastname as 'Apellidos',
c.shortname as 'Codigo Curso' , c.fullname as 'Curso',
DATE_FORMAT(FROM_UNIXTIME(cp.timeenrolled),'%Y-%m-%d') as 'Fecha de Inicio',
case
when DATE_FORMAT(FROM_UNIXTIME(cp.timecompleted),'%Y-%m-%d') is not null then
'Sí'
when DATE_FORMAT(FROM_UNIXTIME(cp.timecompleted),'%Y-%m-%d') is null then 'No'
end
AS completado
FROM prefix_course_completions AS cp
JOIN prefix_course AS c ON cp.course = c.id
JOIN prefix_user AS u ON cp.userid = u.id
WHERE c.enablecompletion = 1
ORDER BY u.username

You might also like