Results 1 to 3 of 3
  1. #1
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245

    pulling portions of data

    hey!



    I have a query set up like this:

    ID.. CompanyName....ReturnDate.....Return...

    The date is the last date of every month with a corresponding return. now the returns have been going for years. so there is alot of them each company has a list of returns. I currently have an annualized return. set up like this: avg([Return])*12

    I want to get the 6 month, 12 month, and 18 month anuallized return. so it would be taking the last 6 data points, 12 datapoints and 18 datapoints. all company names send in there returns at different points, so im not able to have a domain. as then my results would be skewed positively or negatively depending on the returns. I need to some how come up with a function which grabs the last number of returns in the list. how would i do this?

    eg. for 6 month return
    avg(last6[Return])*12

    that wont work, just showing what im going to need. thanks,

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Might require a subquery that uses the TOP qualifier. Review: http://allenbrowne.com/subquery-01.html
    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.

  3. #3
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245
    ok, i will. thanks for the link!

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

Similar Threads

  1. Help pulling data from one table to another
    By bigderon88 in forum Access
    Replies: 2
    Last Post: 03-19-2012, 08:33 AM
  2. Pulling data from a scale
    By nkuebelbeck in forum Programming
    Replies: 9
    Last Post: 01-17-2012, 03:25 PM
  3. Listview pulling data from a second table
    By Yesideez in forum Access
    Replies: 8
    Last Post: 06-29-2011, 05:08 AM
  4. Relationships and pulling data.
    By Subhunter in forum Queries
    Replies: 2
    Last Post: 02-08-2011, 01:18 PM
  5. Pulling only certain data from tables.
    By stevman22889 in forum Access
    Replies: 2
    Last Post: 07-15-2010, 06:23 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