Results 1 to 2 of 2
  1. #1
    Daryl2106 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    167

    query function question

    Hi,



    I have four fields containing values returned by a query. I want to add a field to the query that will calculated the average which I can then include in a form and report. When I build I get an error. I'm only learning VBA and SQL and I have exhausted all the possible simple solutions...also, I have been reading some posts that suggest adding to the SQL. How does one know where to add to the SQl statement(s)?? (I know this is probably a stupid question)


    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,616
    There is no built-in function to average fields. If each field will ALWAYS have data, a simple expression will do:

    Average: (field1 + field2 + field3 + field4) / 4

    If any field could be null, then this gets complicated.

    With Access 2010 you can do the calculation in a Calculated field type of the table.

    Access Help has info on building queries that include creating fields with expression.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. function question
    By manic in forum Programming
    Replies: 4
    Last Post: 02-10-2012, 04:14 PM
  2. undefined function in query
    By mejia.j88 in forum Programming
    Replies: 8
    Last Post: 02-07-2012, 03:50 PM
  3. NZ Function in Access Query
    By Rosier75 in forum Queries
    Replies: 2
    Last Post: 11-02-2011, 06:14 AM
  4. Question; Count function ..
    By efleming in forum Queries
    Replies: 4
    Last Post: 05-27-2011, 08:05 AM
  5. Replies: 4
    Last Post: 11-19-2010, 07:21 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