Results 1 to 15 of 15
  1. #1
    ZachAtaiyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    41

    Running Calculations with only certain points.

    Hello all!

    I have a single table with 3 main types of record IDs; FS, FA, and LS. with each record, I will have a number "Score" associated with it. I am looking to sort the scores by the Record ID and run 3 separate calculations, one for each set of data. I would like to then associate the values back to another table.

    Is this possible to run in a single query? If so, is there a direction you would recommend that I start in?



    Thanks!

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    We would need to see your table(s) preferably in a query. Of course you can simply set the RecordID to sort either Ascending or Descending in the query grid.
    Are these 2 tables not linked by their corresponding key?

  3. #3
    ZachAtaiyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    41
    Are these shots helpful?

    Click image for larger version. 

Name:	1.JPG 
Views:	17 
Size:	24.8 KB 
ID:	17788Click image for larger version. 

Name:	2.JPG 
Views:	17 
Size:	83.8 KB 
ID:	17789

  4. #4
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Add your ID to the query grid and sort with either Ascending or Descending.

  5. #5
    ZachAtaiyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    41
    Once I have the data sorted, how do I tell the query to find the average of only the values that start with "FS-"?

  6. #6
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Here is an example of the syntax:
    Avg([FS])
    HTH

  7. #7
    ZachAtaiyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    41
    Thank you for that, but how do I specify what it is finding the average of for those values?

  8. #8
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

  9. #9
    ZachAtaiyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    41
    Dave,

    The article gave some perspective but the function it uses can not be used in Access projects.

    All I am looking to do is average certain values in one field based on selected criteria from another field.

    If[PartID = 'FS-'] Then Avg[Scores whose identifiers begin with FS-]

    I dont know how to do this in access...any other ideas with the new explanation? I really appreciate it!

  10. #10
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    What data type is FS ? Here is another Example:

    HTH
    Attached Thumbnails Attached Thumbnails Average.png  
    Last edited by burrina; 08-25-2014 at 10:56 AM. Reason: Additional Code

  11. #11
    ZachAtaiyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    41
    Quote Originally Posted by burrina View Post
    What data type is FS ? Here is another Example:

    HTH
    If I understand what you are asking correctly, the data type is text

  12. #12
    ZachAtaiyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    41
    Question: If I was to use the method above, would I be able to add criteria to designate "FS-"?

  13. #13
    ZachAtaiyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    41
    So this is what I have so far:

    Click image for larger version. 

Name:	123.PNG 
Views:	9 
Size:	10.8 KB 
ID:	17933Click image for larger version. 

Name:	124.PNG 
Views:	9 
Size:	19.3 KB 
ID:	17934

    Now how do I find the average of 750, 162, and 162? HELP PLEASE!

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Sounds like a CROSSTAB query. This would require creating a field in query with expression that extracts the alpha part of the PartID.

    Or emulate CROSSTAB with expressions. Review: http://www.datapigtechnologies.com/f.../crosstab.html


    BTW, advise no spaces or special characters/punctuation (underscore is exception) in naming convention.
    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.

  15. #15
    ZachAtaiyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    41
    UPDATE:

    I found a solution for what I was looking for. For each FS, LS, and FA, I made an Additional identifier. I used that Identifier to sort scores into those categories in a crosstab query and then used a normal query to find the average of those values.

    Much easier than I was thinking....Thanks for the point in the right direction June7!

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

Similar Threads

  1. Using decimal points in text 1.2.3
    By dichotomous2013 in forum Access
    Replies: 3
    Last Post: 01-30-2013, 06:49 PM
  2. Reward Points Calculation
    By imran in forum Access
    Replies: 6
    Last Post: 07-26-2012, 09:27 AM
  3. bullet points
    By cbrsix in forum Reports
    Replies: 2
    Last Post: 10-31-2011, 02:16 PM
  4. stuck at some points !!
    By almoj4ever in forum Access
    Replies: 3
    Last Post: 09-25-2011, 05:44 PM
  5. what is my points in the forum
    By weekend00 in forum Access
    Replies: 9
    Last Post: 09-01-2010, 02:40 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