a transaction is a keyword please cover it with backtick transaction
you are missing one parenthesis after transaction.transactionamount
another thing COUNT (), SUM () should be like COUNT(),SUM() no extra spaces required in function.
SELECT
DISTINCT `transaction`.transactionservicetype AS Product,
count(`transaction`.transactionid) AS Count,
sum(`transaction`.transactionamount) AS Amount,
sum(statement.statementdebit) AS NetCost
FROM `transaction`
RIGHT JOIN statement ON `transaction`.transactionid =
statement.transactionid
WHERE `transaction`.transactiondate = '2018-01-17' AND
`transaction`.transactionservicetype = 'LBread';
transactionis a keyword. you should change your table name