MySQL Syntax Error using FROM
Change

    call.duration,
-- agentactivity.State
FROM shorewarecdrarchive.connect


to

call.duration --removing the comma
-- agentactivity.State
FROM shorewarecdrarchive.connect


or

call.duration,
agentactivity.State --uncommenting this line
FROM shorewarecdrarchive.connect


The problem is the trailing comma at the end of call.duration