Need Help with Dates in Exported Reports

Need Help with Dates in Exported Reports

by Ellen Kinsel -
Number of replies: 1

When I run a Configurable Report and export it to ODS, CSV, or XLS, the dates are exported as text rather than dates. Is there a way to force the exported dates to store as dates in the spreadsheet?

How do I get the dates that show up as 12/31/1969 to show as real data? The correct dates show, for example, in the Enrolled Users screen, but not when I use a configurable report to get course enrollment dates.

Also, can I add the date of first access to this modified version of the SCORM report (I have tried without success...I am not an expert at SQL):

--------------------------------------------------

SELECT u.username USER, c.fullname Course,
FROM_UNIXTIME(st.timemodified,"%m/%d/%Y %I:%i %p") AS Completed,
sc.name scormname
FROM prefix_scorm_scoes_track AS st
JOIN prefix_user AS u ON st.userid=u.id
JOIN prefix_scorm AS sc ON sc.id=st.scormid
JOIN prefix_course AS c ON c.id=sc.course
WHERE c.id='152'

ORDER BY u.username, c.fullname, st.attempt

------------------------------------------------

I am using Moodle 3.1.1+ (Build 20160721). We are not upgrading this site as it is going to be retired within the next 6 months (corporate client moving to a different LMS).

Thanks for any assistance you can provide.

Average of ratings: -
In reply to Ellen Kinsel

Re: Need Help with Dates in Exported Reports

by Gary Lynch -

Hi Ellen

I have more experience with Postgresql than mysql but looking around on google could it be you need to format your date ?


DATE_FORMAT(FROM_UNIXTIME
  (st.timemodified),'%Y%m%d<br>%D %M %Y')
    AS 'Completioned'

HTH

Gary smile

PS if my post helps consider rating smile