Hi,
I'm having a hard time figuring out the best way to write an SQL query to do
the following.
I want to search a whole table (every field) for a word like "software" and
filter it by multiple clients and vendors that the user has chosen.
This is my SQL so far, but it doesn't work
SELECT Etlpws.unqentry, Etlpws.category, Etlpws.client, Etlpws.vendor,;
Etlpws.desc, Etlpws.wsaddy, Etlpws.wsfolder, Etlpws.wstaticip,;
Etlpws.swprodname, Etlpws.swprodkey, Etlpws.swpurdate, Etlpws.swcategory,;
Etlpws.swtype, Etlpws.swusers;
FROM ;
etlpws;
WHERE ( ( ( Etlpws.category = ( "software key" );
AND Etlpws.client = ( "External Client" ) );
AND Etlpws.client = ( "My Company" ) );
AND Etlpws.vendor = ( "Microsoft" ) );
AND Etlpws.vendor = ( "IBM" );
AND Etlpws.desc LIKE "%software%";
ORDER BY Etlpws.client, Etlpws.fullname;
INTO CURSOR Sw_query
So I have 2 problems.
1. I can't figure out a way of telling the above SQL to search every field
for my search term. I'm currently only testing using one field which is the
'desc' field. But need this to search all the fields.
2. The multiple where statements "AND Etlpws.client" end up displaying
every record that matches the client name which is correct, but it's
including records that don't have a matching "software" result found in the
"DESC" field. So instead of getting 2 results, I end up with 58 records
with the wrong data in it. I've tried changing it to say OR instead of AND
but then this displays 0 results.
Can anyone point me in the right direction?
Thanks
Tristan