+ Reply to Thread
Results 1 to 3 of 3

Are Values in Query?

Hybrid View

  1. #1
    Registered User
    Join Date
    11-05-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Are Values in Query?

    I have a query that populates a large some of individuals as well as their respective transactions (each of which is tagged with a type code)

    For Example
    Name: Code:
    John 1
    Joe 34
    James 1
    John 2
    John 1
    John 37
    Joe 2

    I also have a table with all of the codes and their descriptions:
    Code Desc
    1 Food
    34 Apples
    6 Candy
    2 Franks
    37 Burgers

    The query generates over 60,000 rows. What I am looking to do is see which of the codes in the table appear in the query when it is run.
    Code Desc Y/N
    1 Food x
    34 Apples x
    6 Candy
    2 Franks x
    37 Burgers x

    It doesn't necessarly have to be a solution tagging them I just cant figure out how to do this.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,716

    Re: Are Values in Query?

    Please post your SQL statement as I am not visualizing your situation from your narrative. I am thinking that you probably need to use the Aggregate function with the count of the descriptions or codes for descriptions.

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,716

    Re: Are Values in Query?

    I think that I may figured out what you want. Look at the attached. It is two queries. The first determines the count of each item. The second does an outer join of all products against the first query. Those items not having a count, appear without a description in the first description field. Does this solve your issue?
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1