Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009
    Posts
    4

    Unanswered: fitler criteria in a query

    i have a query that returns hundreds of accounts with the transactions per account. I want to be able to limit the results to only a group of about 50 accounts. i have the list of accounts that ive specified in a separate table called accttable. The accounts are all based on a combo of 6 numbers, acctnum (example: 123456).

    how to i edit the criteria to return results only for specified accounts in the accttable?

    something like: if( acctnum = acctnum in accttable, return the row, else skip)


    Does this make sense? I just got thrown into access. usually use excel
    Thanks!
    RM

  2. #2
    Join Date
    May 2008
    Location
    Big Lake, MN
    Posts
    18
    There are a couple ways you could write the query to look only at those accounts.

    select *
    from maintable
    where acctnum in(select acctnum from accttable)

    I'm not too great with Access syntax, but a join would work also.
    If I had any wisdom to impart, I would do so here.

  3. #3
    Join Date
    Dec 2009
    Posts
    4
    wait, where would I put this code?
    (select *
    from maintable
    where acctnum in(select acctnum from accttable)

    I am not sure how everything works with access. This page below looks promising. is it similar to my problem?

    SELECT Statement (Microsoft Access SQL) [Access 2007 Developer Reference]

  4. #4
    Join Date
    Dec 2009
    Posts
    4
    nvm i figured out its in sql view...

    haven't used sql before. would learnings sql make my life in access easier?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •