Results 1 to 2 of 2
  1. #1
    Briana is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    1

    Query with Complicated Requirements

    Hi


    The end goal is to create a report that you type in the Household Name and all the past transactions of the stocks traded in that year are listed by account. Right now it is set up so that I have a query that searches for all the stock sales for the year if I type in a Household Name. When the report pops up I see that the customer sold Company A in one account and Company B in another account. Then I take that information and use the company names of the sold stock as the criteria to find all the transactions relating to that stock from past years--- both bought and sold. Is there a way to tell access to first find the companies sold for each account for a household and then find all the transactions having to do with that company and account in the past.

    Example:
    SOlD IN 2012
    AT&T SOLD 300 Shares
    DUK SOLD 200 Shares

    AT&T PAST Transactions
    Bought 200 Shares of AT&T
    Sold 50 Shares of AT&T
    Bought 400 Shares of AT&T

    DUK PAST TRANSACTIONS
    Bought 200 Shares of DUK
    Sold 50 Shares of DUK
    Bought 400 Shares of DUK

    Anything that combines them would be great.

    Thanks in advance!!!!

  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,921
    Maybe. Something like:

    SELECT * FROM transactions WHERE companyID IN (SELECT companyID FROM table WHERE household=[input HH ID]);

    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.

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

Similar Threads

  1. Replies: 4
    Last Post: 03-31-2012, 10:52 AM
  2. Rules and Requirements in a Form
    By Kirsti in forum Forms
    Replies: 9
    Last Post: 02-01-2012, 06:37 PM
  3. Complicated Query (Interleave rows?)
    By crozfader in forum Queries
    Replies: 8
    Last Post: 09-19-2011, 12:15 PM
  4. Complicated Query needs some date range help
    By KevinMCB in forum Queries
    Replies: 1
    Last Post: 01-11-2011, 12:25 PM
  5. Importing Excel into Access with few requirements
    By pickolizac in forum Import/Export Data
    Replies: 1
    Last Post: 02-18-2009, 12:02 AM

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