Thanks so much for getting back to me. I know you are a busy guy, so I really appreciate your feedback.
I understand what you are saying. I agree it is probably not worth the effort, considering its potential inaccuracy factor. And besides, the student can always do the sum in their heads from the enrollment date in respect to the time the course was completed. I do have that in place now, so I am happy.
Here is the SQL script for anyone who might be able to benefit from it also.
SELECT u.lastname AS 'Last Name',u.firstname AS 'First Name' , u.username As 'Username', u.email AS 'Email', cc.name AS 'Organization', u.country AS 'location', c.shortname AS 'Series title', DATE_FORMAT(FROM_UNIXTIME(p.timeenrolled
),'%m-%d-%Y at %m:%s%p')
AS 'enrolled in series', DATE_FORMAT(FROM_UNIXTIME(p.timecompleted
),'Completed %m-%d-%Y at %m:%s%p')
AS 'series completed', gi.itemname AS 'Session title',
if (ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2) > 79,'Yes' , 'No') as 'Session 100% Viewed', DATE_FORMAT( FROM_UNIXTIME( gg.timemodified ) , '%m-%d-%Y at %m:%s%p' ) as 'last view date'
FROM prefix_course_completions AS p
JOIN prefix_course AS c ON p.course = c.id
JOIN prefix_user AS u ON p.userid = u.id
JOIN prefix_course_categories AS cc ON cc.id = c.category
JOIN prefix_grade_grades AS gg ON gg.userid = u.id
JOIN prefix_grade_items AS gi ON gi.id = gg.itemid
WHERE gi.courseid = c.id and gi.itemname != 'Attendance'
ORDER BY u.lastname, cc.name, u.country, c.shortname, gi.itemname
NOTE: I have altered the naming convention so courses are Series, activities are Sessions, and categories are Organizations.
Now, if I can just get capitalized headings to appear, opposed to all lowercase!