SQL query

  neon67 02:28 05 Apr 03

I have a table which contains organizations address and the service they provide.
Organization Area Service
A Place1 x y z
B Place2 y

I've managed to write the sql to select records that provide a certain service and in a certain area.
FROM tablename
WHERE services LIKE '%varservices%'
AND Area ='varArea'
ORDER BY Organization ASC

I have a search page which lets users search by service provided and area. Area choices are "place1" "place2" etc.
What I would now like to add to my search is when someone enters "any area" as search parameters it returns all the records. Any help would be appreciated.

  AccessMoron 09:59 05 Apr 03

The best way would be to build the WHERE statement on the fly.
Check for values in each search field, if its there then add this to the serch, if its not there then go and check the next search option.

This thread is now locked and can not be replied to.

Surface Pro (2017) vs Surface Pro 4

Where HTML5 is headed next

MacBook Pro v Surface Pro 5