Forums

This topic is locked

Problems in Sql - Ultradev?

Posted 21 Sep 2001 12:27:17
1
has voted
21 Sep 2001 12:27:17 Henrik Sandeberg posted:
I have a database with telephone numbers and names, mobil and so on, and when im doing a search for a person and that person doesnt have a mobil number, that record will not show up at all., My sql is: Select * from telef where firstname LIKE '%firstname%%' AND secondname LIKE '%secondname%%' AND mobilenr LIKE '%mobilenr%%'.

Hope I have explained the problem,, ?

Henrik

Replies

Replied 21 Sep 2001 13:18:41
21 Sep 2001 13:18:41 Owen Eastwick replied:
Do you want to find the mobile number from either the first name or the last name?

If so:

SELECT *
FROM telef
WHERE firstname LIKE '%firstname%' OR secondname LIKE '%secondname%'

If you want to be able to find the name by searching for the telephone number as well:

SELECT *
FROM telef
WHERE firstname LIKE '%firstname%' OR secondname LIKE '%secondname%' OR mobilenr LIKE '%mobilenr%'



Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo

Reply to this topic