Forum Discussion

Nkhatiwada's avatar
Nkhatiwada
Copper Contributor
Sep 16, 2020
Solved

SQL or Access query code for filtering the data

Can anyone help me, please. I need immediate help with SQL or Access query codes to show the values in my resultant table below.  Thank you in advance. 

 

For an example:

I have table1

IDTypeMaterial
1ECNCSTL
2EFCLLED
3EFCLOHL
4EFCLSTV
5EFCLSTL
6EFCLNLU
7ESICSTV

 

I want to see only these in my result 

IDTypeMaterial
1ECNCSTL
   
3EFCLOHL
   
   
6EFCLNLU
7ESICSTV

 

 

  • Woldman's avatar
    Woldman
    Sep 16, 2020

    Nkhatiwada You could use this query: 

     

    SELECT *
    FROM Material
    WHERE Type <> 'EFCL' OR (Type = 'EFCL' AND Material NOT IN('STL', 'STV', 'LED'))

     

     

    I took "Material" as table name, you can replace it with your table name. 

     

    Best wishes,

    Tieme

3 Replies

  • Nkhatiwada's avatar
    Nkhatiwada
    Copper Contributor
    I want to hide only STL, STV or LED materials that are EFCL types.
    • Woldman's avatar
      Woldman
      Iron Contributor

      Nkhatiwada You could use this query: 

       

      SELECT *
      FROM Material
      WHERE Type <> 'EFCL' OR (Type = 'EFCL' AND Material NOT IN('STL', 'STV', 'LED'))

       

       

      I took "Material" as table name, you can replace it with your table name. 

       

      Best wishes,

      Tieme

Resources