Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2009

    Unanswered: help with Criteria in query

    hello,I am new to access and have run into a problem.

    i have a query that returns information for hundreds of accounts. I only want to return information for about 50 of those accounts. When I try to put only the accounts I want information on into the criteria box (example "012345" or "123456" or "234567" or ...) I run out of space eventually. It says there is a 1,024 character limit.

    Is there a way I can create a table and have the query return only accounts that are specified in the table?

    Thanks in advance!

  2. #2
    Join Date
    May 2005
    Yes, you could create a table with all the specified accounts, and then use an INNER JOIN with that new table and the table with the other account information you want.

    Is there any criteria for which of these accounts you want other than just a list of a thousand odd numbers? Because it would be a whole lot easier for you if you could just specify a simple WHERE criteria that evaluates to the accounts in question.
    Me.Geek = True

  3. #3
    Join Date
    Mar 2009
    Provided Answers: 15
    If you really want or need to enumerate the values you're looking for in the query, you can do it more easily by using the SELECT IN () syntax:
    SELECT ... FROM ... WHERE XXX IN ("ABC", "DEF", ... etc.)
    But the lookup table and INNER JOIN query would be better if you can use it.
    Have a nice day!

Posting Permissions

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