I'm trying to calculate some columns in a mysql database with this code:
"SELECT SUM(klick) FROM svar GROUP BY pollid HAVING pollID="& rstPoll("PollId")
But it doesn't work. So what I want to do is to get the sum of all "klick" where a pollId has a certain value. I got this code to work with access but not with mysql:
"SELECT SUM(klick) FROM svar WHERE pollID="& rstPoll("PollId"))
Some lines in the database: id: 180 klick: 10 pollid: 56
id: 181 klick: 53 pollid: 56
id: 182 klick: 10 pollid: 56
Now I want the sum of all the klick where pollId = 56 for example. So the results here would be: 73