PDA

View Full Version : Data Assist Search Question


Ian
04-30-2009, 05:41 PM
Hi Ray,

With Data Assist Search is it possible to do a "IN" query like in MSSQL.

So if I have an array of numbers (say item IDs) like this "23,54,34,76,45,54" in a session variable could I use Data Assist search to do:

Select * From products WHERE itemid IN <%=Session("array")%>

I think there is an INCLUDES query type. Would that work?

Cheers
Ian

Ray Borduin
05-01-2009, 06:39 AM
You can use "list" type search and pass the array object as the value. DataAssist Search works with arrays directly. You probably still want to use "=" since you are looking for an exact match.

It won't exactly do an IN search, but it will achieve the same result with a complex WHERE statement joined by OR.... something like: WHERE (ID =23 OR ID=54 OR ID =34 OR ID = 76)

The same end result, so it should work for you.