All right. So i have child, parent, activity and register table and i want know how much money a parent will pay for his child if the child have 1 or more activities.
So i came out with this code:

  CONCAT_WS (' ', parent_title, parent_fname, parent_sname) AS 'Parent/Carer Name',
  CONCAT('£', act_price) AS Amount,
  COUNT(*) AS 'Nr of Act.'
FROM Activity A, Parent P, Child C, Register R
WHERE C.parent_id = P.parent_id AND
      C.child_id = R.child_id AND
      A.act_id = R.act_id
GROUP BY P.parent_id

and see atachment for result.

the thing is in the Amount column the value are all £0.00
any ideea anyone?


CONCAT('£', act_price) AS Amount,


sum(act_price) AS Amount,

still the same mate

found it

CONCAT('£', SUM(act_price)) AS Amount,

thank you anyway for your help mate

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.