Forum Moderators: open
Problem is, Dreamweaver MX won't let me use the AND statement. I've written SELECT ID, brand, model FROM my_database WHERE brand LIKE '%MMColParam%' AND model LIKE '%MMColParam2%' The value of the two column parameters are Request.Form("brand") and Request.Form("model").
When I go to do the search, the results come up empty. However, if I change the AND to OR, the results come up. Problem is that I can mix models and brands and come up with a search result that's not correct. For whatever reason, the model always seems to take precedence.
Any ideas on how to handle this problem?
Thanks much for any replies.
SELECT ID, brand, model FROM my_database WHERE brand LIKE '%MMColParam%'
Then
SELECT ID, brand, model FROM my_database WHERE model LIKE '%MMColParam2%'
Make sure your request variables are Trimmed for trailing spaces.
Duckhunter, can you use two "Select" queries within a single recordset?
Admittedly, I've only done a couple of database-driven sites, but I've used the AND statement together with parameter values successfully. Those sites used Access databases. This site uses MS SQL. Don't know if that makes a difference.
Just when I thought I was home free.
Dang, there goes the weekend!
ie: it might be searching for "SONY " and not "SONY"
You might have to RTRIM(brand) or RTRIM(model) to strip of trailing spaces if you are using a CHAR field type instead of VarChar. I know you have the % but CHAR fields can behave strangely. Use VarChar whenever possible.