SQL query

  neon67 02:28 05 Apr 03
Locked

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.
SELECT *
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.

Nintendo Switch review: Hands-on with the intuitive modular console and its disappointing games…

1995-2015: How technology has changed the world in 20 years

This abstract video touches on division in our technologic world

Best alternatives to iTunes for Mac | Best music players for macOS: Free your music from the…