I've done research on this and it appears that I can't update queries w/ aggregates in the select statement. The problem is I need a way around this. I have a daycare db and I'm trying to allow the users to update the tuition info for the entire family on one screen. This screen includes the parent name, frequency of their payment (weekly or bi-weekly), tuition total, number of children, sibling discounts, other discounts, total amount covered. My SQL statement is below, please let me know if you need more info
Code:
SELECT (par_first_name&' '&par_last_name) AS parent_full_name, count(student_id) AS num_of_act_children, ft.frequency, ft.sib_discounts, ft.other_discounts, sum(tui.general_tuition) AS ttl_gen_tuition, sum(v.amt_cvrd) AS ttl_amt_cvrd
FROM (((tuitions AS tui INNER JOIN students AS s ON tui.tui_student_id = s.student_id) INNER JOIN vouchers AS v ON tui.voucher_type = v.voucher_type) INNER JOIN parents AS p ON s.stu_parent_id = p.parent_id) LEFT JOIN family_tuitions AS ft ON ft.ft_parent_id = p.parent_id
WHERE (((s.stu_active)=True))
GROUP BY (par_first_name&' '&par_last_name), tui.general_tuition, v.amt_cvrd, ft.frequency, ft.sib_discounts, ft.other_discounts;
Thanks in advance everyone!