Results 1 to 3 of 3
  1. #1
    jwill is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Mar 2012
    Location
    MD
    Posts
    67

    Ways around my non updateable query

    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!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Well, if you were to want to edit the sum of tuition field, how is Access supposed to know what actual record(s) you intend to change? You are correct that a totals query is read-only, because there's no way for Access to know how to apply an edit. You would need to display the individual records that make up that total so the user can edit the base record.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jwill is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Mar 2012
    Location
    MD
    Posts
    67
    Thanks for the quick response Paul. I'm just trying to allow the user to update the discount fields and frequency fields. The others are updated in other forms.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. updateable query with max()
    By ElRudi in forum Queries
    Replies: 11
    Last Post: 12-15-2011, 02:55 PM
  2. Must use updateable query
    By adams.bria in forum Queries
    Replies: 1
    Last Post: 08-29-2011, 10:31 AM
  3. Need Query To Be Updateable
    By robsworld78 in forum Queries
    Replies: 11
    Last Post: 07-17-2011, 09:06 PM
  4. Non-Updateable Query
    By swalsh84 in forum Queries
    Replies: 4
    Last Post: 04-27-2011, 12:39 PM
  5. Operation must use an updateable query
    By skaswani in forum Queries
    Replies: 0
    Last Post: 12-23-2010, 11:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums