General help

Report all logs between two dates M-2.5

 
 
Womble
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.

Can anyone help please?


Regards


Michelle


 
Average of ratings: -
Picture of Howard Miller
Re: Report all logs between two dates M-2.5
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Something like...

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

...obviously substitute your required dates. 

 
Average of ratings: -
Womble
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: -
Womble
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: -
Womble
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: -
Picture of Dave Balch
Re: Report all logs between two dates M-2.5
Group DevelopersGroup Particularly helpful Moodlers

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: -
Womble
Re: Report all logs between two dates M-2.5
 

Dave thanks for your reply but i have absolutely no idea.


the error message means nothing to me.

 
Average of ratings: -
Head
Re: Report all logs between two dates M-2.5
Group Particularly helpful MoodlersGroup Testers

Michelle;

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

Thanks,
Jon

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

a new adhoc database query.

 
Average of ratings: -