We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,682 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Retrieving currency field data

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:

SELECT
  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?

Attachments a.html (1.68KB)
2
Contributors
3
Replies
1 Hour
Discussion Span
1 Year Ago
Last Updated
4
Views
Octipus
Newbie Poster
3 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Replace

CONCAT('£', act_price) AS Amount,

by

sum(act_price) AS Amount,
smantscheff
Nearly a Posting Virtuoso
1,297 posts since Oct 2010
Reputation Points: 321
Solved Threads: 270
Skill Endorsements: 8

still the same mate

Octipus
Newbie Poster
3 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

found it

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

thank you anyway for your help mate

Octipus
Newbie Poster
3 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0759 seconds using 2.67MB