partial input a typical question for typical guys

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Friends,
I need some help in devloping a simple query. I developed a database
application which will take a user "FIRST NAME" or " Last name" or BOTH to
retive his detials. The problema here are:

1) If I give only partial name like" JO" it should return all names which
had JO in theier name

EX: input : JO
output: JOHN, JOE. JOESPH, ROJO
2) If I give a name it should retun all names wihch had that input.

EX: input: ROSE
output: ROSESMITH, JANNISROSE.....

I appriciate if any one who send or give the code for the query or VBA or
ASP code.(Anyformat)
Thanks
SAN
 
Thx for your reply but its not working, I am using this query in ASP,but it
isnot working Can you know another way?
Thx
 
can i see some of your code?


SAN NAN said:
Thx for your reply but its not working, I am using this query in ASP,but
it
isnot working Can you know another way?
Thx
 
Yes you can.

strFirstName=Request.Form("txtFirstName")
strLastName=Request.Form("txtLastName")

strSQL=" Select * from Employee_Names where Employee_Names.FIRST_NAME LIKE
'" & strFirstName &"' OR Employee_Names.LAST_NAME='"& strLastName &"'"

This si the code for my query.
 
strSQL=" Select * from Employee_Names where Employee_Names.FIRST_NAME LIKE
'" & strFirstName &"*' OR Employee_Names.LAST_NAME='"& strLastName &"*'"

use *'s like i did in the above suggestion.
 
Perhaps

strSQL=" Select * from Employee_Names where Employee_Names.FIRST_NAME LIKE
'*" & strFirstName &"*' OR Employee_Names.LAST_NAME='"& strLastName &"'"

OR strSQL=" Select * from Employee_Names where Employee_Names.FIRST_NAME LIKE
'%" & strFirstName &"%' OR Employee_Names.LAST_NAME='"& strLastName &"'"
 
Back
Top