ASP Database queries from multiple selections in forms - 3/9/2001 18:09:00
Hi,I am new to web programming, and to your forum. But, I keep coming back here for answers to questions, so I thought it was time to post my own. I am trying to pass the results from a multiple selection form to a fp_sQry= "SELECT..." query in an *.asp page. If the parameter coming in is numeric, my code works fine. If the parameter coming in is text, I can't get it to work. Here's the query: strQry = " SELECT * " FROM Air_Obs " & _ " WHERE ((Air_Obs.Site_ID IN (::Site_ID: " & _ " AND (Air_Obs.Parameter_ID IN ('::Parameter_ID::') " & _ " AND (Air_Obs.Obs_Date BETWEEN #::StartDate::# AND #::EndDate::#))" Site_ID IN (::Site_ID: is numeric and works like a charm. However, Parameter_ID is being sent as a comma delineated string without the single quotes around the text (BSO4, Si, Cl). I think the query wants it to be ('BSO4', 'Si', 'Cl'). How do you get this relatively simple query to work properly? It will work if I only make one selection, and when I hard code some values into the query (obviously not what I need!). Any help would be greatly appreciated. My head is sore from banging it against my monitor... Monica
|