SELECT * FROM texasPML WHERE title like '%Chester%' and composer like '%%' and arranger like '%T%'
I am returned "Chester", "Billings", and "Osterling" which is a valid entry, but Osterling doesn't start with a "T".
When I put "To" in the arranger field, my SQL looks like this:
SELECT * FROM texasPML WHERE title like '%Chester%' and composer like '%%' and arranger like '%To%'
I am returned "Chester" "Billings" "Tolmadge" which is correct.
Why would the letter "T" by itself not be picked up, yet the "To" is?
I'm using Access with ASP.
Thanks.
SELECT * FROM texasPML WHERE title like '%Chester%' and composer like '%%' and arranger like '%T%'
For some reason the query doesn't like Mr. Butler as a composer.
According to your SQL, you dont have anything specified fr the composer and if Mr.Butler is listed there, he can't be found when searching the table 'arranger'.
Or have I misunderstood?
(edited by: JuDDer at 5:22 pm (utc) on May 16, 2002)
This yields the same results. Only 1 row returned.
this one, however:
SELECT * FROM texasPML WHERE composer like '%Butler%'
returns the correct number of rows. I think I know what I need to do in the query.....
When I was assigning the variables I was checking for "undefined" but not for "null". The QueryString looked like this: T=&A=&C=Butler T and A were null.
So I modified my variable definition as follows:
if(String(Request.Form("T")) != "undefined" && String(Request.Form("T")) != "null")
A second wrinkle came up though. If the db field was blank, the wild card didn't work either. So I tested each part of the where clause. If the parm was blank I didn't include that part in the SQL statement.