criteria specifications

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cody12345
    New Member
    • Dec 2008
    • 4

    criteria specifications

    I have a several rows say
    Location part # product code
    105 E05 DX
    104 1740 DX
    104 2047 DX



    I want a way to find a way in chriteria thet i can find all related info on these parts.
    When i ran this query it only gave me the product code DX
    I know you can use wild cards in queries but this is to specific and i would need all info related to the seperate part numbers if they were expanded.
    is there a way to set chriteria to find all related numbers of my list using the first 3 characters, so it will give me any other part number product code that even contain say E05.

    have a several rows say
    Location part # product code
    105 E05 DX
    106 E055 RX
    104 1740 DX
    105 1740-567 FX
    104 2047 DX
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    You can use the LIKE condition. See examples here:
    SQL: LIKE Condition

    If you want to match 4 different sets of numbers like that I think you could do
    WHERE id LIKE '12345%' OR id LIKE '16564% or id LIKE etc.
    Last edited by ChipR; Dec 4 '08, 09:30 PM. Reason: syntax

    Comment

    • Cody12345
      New Member
      • Dec 2008
      • 4

      #3
      Ya that works the only thing is i have say 800 rows.

      Is there a way to use the like for the characters in the feild with out being so specific

      select *
      FROM Part #
      WHERE Part # LIKE ' ( say the first 4 character)

      Or something that could be applied to the whole table without going throught each number?

      Comment

      • ChipR
        Recognized Expert Top Contributor
        • Jul 2008
        • 1289

        #4
        I don't understand the question. That's exactly what LIKE '1234%' does. The select is going to have to look at the part number of each record in the table regardless.

        Comment

        • FishVal
          Recognized Expert Specialist
          • Jun 2007
          • 2656

          #5
          Hello, Cody.

          You could try join the datasets on partial match.
          Code:
          SELECT [AllRecords].* FROM [AllRecords] INNER JOIN [SeveralRows] ON [AllRecords].[part #] Like '*' & [SeveralRows].[part #] & '*';

          Comment

          • Cody12345
            New Member
            • Dec 2008
            • 4

            #6
            ya i understand that but i want the like'12345%' of all 800 part numbers... meaning.....

            If i have all of the part numbers below i want the like'E05%', and the like'1740%' and the like'2047%' and so on and so on for all 800 part numbers.

            E05
            1740
            2047
            4521
            21601
            BM153
            BM495
            BM752
            FCE45
            FXD28
            2248
            2433

            Comment

            • Cody12345
              New Member
              • Dec 2008
              • 4

              #7
              thanks fishval ill try that!

              Comment

              Working...