Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Squeling for SQL help

Status
Not open for further replies.

badlad

Technical User
Feb 5, 2002
7
0
0
GB
I have a form with 1 textbox (txtSearch) and a 1dropdown (dropdown), the textbox is the search string and the dropdown is a list/menu of which the values=the 3 columns in the Access database.

the form is set to GET and the correct asp file is set as results.

My knowledge of SQL is still in it's infancy, so any help would be much appreciated.

I know that the initial sql statement is:-

SELECT *
FROM tablename
WHERE .............

Can anyone fill in the blanks, to complete the sql statement in advanced.

failing that a similar sql statement that uses 1 textbox and searches 3 columns in 1 table.

I am happy at simple searches and filtering and sorting 1 column.

Pete Heseltine

The Heseltine Network.


mailto:peter.heseltine@heseltine.net
 
vSql="SELECT cars.* FROM cars WHERE (((cars.brand)='" & Request.Form("txtSearch") & "'));"

where "cars" is the name of your table "*" means select all fields, "brand" is the field brand in your table.

ie. Table "cars"
Field name--> brands models value
ford mustang f1
ford focus f2
honda civic h1
honda prelude h2

and so on.......

Post if you need more info. ;-) Have Fun...

Sharky99 >:):O>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top