Hi David,
It seems the divide by zero error must happen by rows in the sts_ga_MediumData that have 0 for the Visits column. I "thought" I had coded the API query that populates that table so that it would not add rows with 0 in that column, ie they should have been filtered out.
I'd run a query to see how many rows are like that
SELECT Count(*) FROM sts_ga_MediumData WHERE Visits = 0
Then I guess you could either delete those rows
DELETE FROM sts_ga_MediumData WHERE Visits = 0
or update them to 1 to avoid the error.
UPDATE sts_ga_MediumData
SET Visits = 1
WHERE Visits = 0
Haven't seen this error before so not sure how those 0 rows got in there.
Hope that helps,
Joe