Resend - Define Correct Criteria

T

ttp

I sent this question earlier; but I can't see the response. Will you please
resend the suggested solution?

Attached is a snapshot of a table being used in a query. The query criteria
is based on the TURBINE_TECH and ORDER_SOURCE. I need to obtain all Steam
records (TURBINE_TECH = "STEAM") and all Generator records except those
associated with GCE (TURBINE_TECH = "GEN*" and ORDER_SOURCE<> "GCE"). When I
set up the query, I put the following statement in the SQL: Where
(TURBINE_TECH = "STEAM" OR (TURBINE_TECH = "GEN*" And ORDER_SOURCE <> "GCE)).
But the results are also removing the steam GCE records which I need. Can
anyone assist me?

ORDER_NUM TURBINE_TECH ORDER_TYPE ORDER_SOURCE
1041772 GENERATOR Contractual Services GCE
1041812 STEAM Energy Parts - GEII Copy
1041818 GENERATOR Performance Services EAM AUTOLOAD
1041911 STEAM Energy Parts - GEII GCE
1000075 GENERATOR Performance Services CONVORDERS

Thanks in advance for any assistance.
 
M

MGFoster

ttp said:
I sent this question earlier; but I can't see the response. Will you please
resend the suggested solution?

Attached is a snapshot of a table being used in a query. The query criteria
is based on the TURBINE_TECH and ORDER_SOURCE. I need to obtain all Steam
records (TURBINE_TECH = "STEAM") and all Generator records except those
associated with GCE (TURBINE_TECH = "GEN*" and ORDER_SOURCE<> "GCE"). When I
set up the query, I put the following statement in the SQL: Where
(TURBINE_TECH = "STEAM" OR (TURBINE_TECH = "GEN*" And ORDER_SOURCE <> "GCE)).
But the results are also removing the steam GCE records which I need. Can
anyone assist me?

ORDER_NUM TURBINE_TECH ORDER_TYPE ORDER_SOURCE
1041772 GENERATOR Contractual Services GCE
1041812 STEAM Energy Parts - GEII Copy
1041818 GENERATOR Performance Services EAM AUTOLOAD
1041911 STEAM Energy Parts - GEII GCE
1000075 GENERATOR Performance Services CONVORDERS

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When using a wild-card in a Text column (field) you have to use LIKE:

WHERE turbine_tech = 'Steam'
OR (turbine_tech LIKE 'Gen*' AND order_source <> 'GCE')

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBScG6mYechKqOuFEgEQK9IgCeIRNivmKA+y6e/7KJB2iobKhk9BEAmwfH
mjuR6nciy9E4mQPI1bWlDWDu
=CDWF
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top