Results 1 to 6 of 6
  1. #1
    GrasshopperKing is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Sep 2018
    Posts
    3

    Help needed builing a simple Expression to calculate Wean Index

    I need an expression to take the AvgADA on the qryAvgADA/Year query to a new column on the qryWeanIndex query so that I can calculate a Wean Index which is ADA/AvgADA X 100. It needs to take that years AvgADA and match it to the Birth Year, you’ll notice 1996 has two births, so don’t get misled by those years that have identical ADA & AvgADA, I am only using a small sample of data but it will be used to calculate many births per year.

    I have tried Iif statements, Switch statements, and all kinds of things. I am a NOOB and not a very bright one!



    Be most grateful for any help.

    Click image for larger version. 

Name:	WEAN INDEX 1.png 
Views:	18 
Size:	34.9 KB 
ID:	35335Click image for larger version. 

Name:	WEAN INDEX 2.png 
Views:	18 
Size:	25.0 KB 
ID:	35336

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    wont ADA/AvgADA X 100 always = 100?

    You may also want to change your field name from year to something else as year is a reserved word.



  3. #3
    GrasshopperKing is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Sep 2018
    Posts
    3
    Hello and thank you for the reply.

    Yes & No. In this small data set most of them will have an Index of 100 but if you look at 1996 you will see that calculating their index gives you 94 and 105. This is why I mentioned that it would be slightly misleading because of the lack of births, I am expecting to have many hundreds of births a year.

    I need a simple expression to match the years AvgADA with the birth year

    I will certainly change the reserved word to something else.

    Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Consider building report and use its Sorting & Grouping features with aggregate calcs.
    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.

  5. #5
    GrasshopperKing is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Sep 2018
    Posts
    3
    Hello and thank you for your reply,

    I think a report would be useful but only later. I really need it to show up on the subform of each animal performance over its lifetime, 1 birth a year over 8 to 13+ years

    Thanks

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    To accomplish in form options:

    1. An aggregate query for the annual average. Then join that query to the raw data by linking on the year fields. However, this will result in a non-editable dataset.

    2. Use DAvg to calculate the annual average. Domain aggregate can cause slow performance but the dataset will be editable.
    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. simple assistance needed
    By gkaro in forum Access
    Replies: 4
    Last Post: 10-17-2013, 11:41 AM
  2. Help! Very Simple Inventory Needed
    By jflorey in forum Access
    Replies: 7
    Last Post: 08-13-2013, 04:17 PM
  3. HELP! Simple map database needed to be done!
    By retired911 in forum Database Design
    Replies: 1
    Last Post: 01-10-2012, 04:51 PM
  4. Simple help needed
    By canfish in forum Database Design
    Replies: 10
    Last Post: 07-28-2010, 05:13 PM
  5. Replies: 4
    Last Post: 08-30-2009, 12:31 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