JPATX2
Technical User
- Jun 8, 2004
- 3
I have the following query.
SELECT * FROM projects WHERE assembly_type = '2' OR assembly_type = '6' OR assembly_type = '10' OR assembly_type = '14' OR assembly_type = '18' OR assembly_type = '22' OR assembly_type = '26' OR assembly_type = '30' AND status != 'Complete' ORDER BY pnum ASC
It seems to ignore the "AND status !='Complete' " portion. I don't get any errors, but I do not get the results I want. I'm not a very experienced sql person so I'm not even sure if you can use AND and OR in the same statement or if there is alternative. Can someone help me with how I can accomplish this task.
Thank you in advance.
-JP
SELECT * FROM projects WHERE assembly_type = '2' OR assembly_type = '6' OR assembly_type = '10' OR assembly_type = '14' OR assembly_type = '18' OR assembly_type = '22' OR assembly_type = '26' OR assembly_type = '30' AND status != 'Complete' ORDER BY pnum ASC
It seems to ignore the "AND status !='Complete' " portion. I don't get any errors, but I do not get the results I want. I'm not a very experienced sql person so I'm not even sure if you can use AND and OR in the same statement or if there is alternative. Can someone help me with how I can accomplish this task.
Thank you in advance.
-JP