## General help

### Report all logs between two dates M-2.5

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Report all logs between two dates M-2.5

I would like to have a report of the live logs between two dates.

In the past i have exported them each day and at the end of the month i have merged the spreadsheets together.  However I have let this slide and haven't done it for over a year.

I have ad hoc queries installed but no idea how to create what i want.

i do not want some of the suggested reports e.g. per course or user.  i just want all raw logs between two dates.

Regards

Michelle

Average of ratings: -
Re: Report all logs between two dates M-2.5

Something like...

SELECT * FROM mdl_log WHERE time > UNIX_TIMESTAMP('2013-11-01') AND time < UNIX_TIMESTAMP('2014-04-30');

Average of ratings: -
Re: Report all logs between two dates M-2.5

Hmm,

Being daft but I get

Please do to include the table name prefix mdl_ in the SQL. Instead, put the un-prefixed table name inside {} characters.

What does this mean  ?  I don't know SQL.

Thanks

Average of ratings: -
Re: Report all logs between two dates M-2.5

Thanks

but I really can't get this to work.  It won't let me have the ; symbol or I get the message mentioned previously.

Any ideas why

Average of ratings: -
Re: Report all logs between two dates M-2.5

Any help on why this doesn't work would be appreciated greatly.  I really need to get this to work, or I will have to download the individual daily logs for the past 18 months.

Am I missing something in the query?

This is the query Howard provided

SELECT * FROM mdl_log WHERE time > UNIX_TIMESTAMP('2013-11-01') AND time < UNIX_TIMESTAMP('2014-04-30')

This is the error

Please do to include the table name prefix mdl_ in the SQL. Instead, put the un-prefixed table name inside {} characters.

Thanks

Michelle

Average of ratings: -
Re: Report all logs between two dates M-2.5

How are you running the SQL? If it's through Moodle (e.g. get_records_sql() ), you probably just need to change "mdl_log" to "{log}", like the error says:

SELECT * FROM {log} WHERE time > UNIX_TIMESTAMP('2013-11-01') AND time < UNIX_TIMESTAMP('2014-04-30')

Average of ratings: -
Re: Report all logs between two dates M-2.5

the error message means nothing to me.

Average of ratings: -
Re: Report all logs between two dates M-2.5

Michelle;

WHERE are you inputting this SQL statement to get the error?

Thanks,
Jon

Average of ratings: -
Re: Report all logs between two dates M-2.5