Thanks much for the info David! I guess I was saying OR cos' I'm trying to understand all this stuff and how folks might search. Luckily, I've never had to deal with a missing family member, but from the folks who have...who are running this...they tell me that folks get desperate (obviously) and will try to search for anything CLOSE to what might be their loved one found. So we'd look for a hit that would have say blonde hair or blue eyes, versus and, in the hopes that ONE of those traits were recorded in the info...as not all is or always can be.
Again...thanks...I'll check all this out. BTW...if any devs or designers out there have time to volunteer on this project...we could use the help...email me at dianATmousetrax.com if you want more info. Dian ~ -----Original Message----- From: David Smart [mailto:[EMAIL PROTECTED] Sent: Thursday, August 26, 2004 5:10 AM To: [EMAIL PROTECTED] Subject: Re: [ASP] Multi Criteria Searches I assume you have a big form where the user fills in some fields and leaves others empty. Then you want the query to include a lot of tests separated by AND's (not sure why you're saying "OR" - perhaps you're talking about the ASP that puts it together). I'd do it in two steps: Firstly, buzz through the form concocting test clauses (complete with their surrounding parentheses) and put them into consecutive spots in a temporary array. In JScript, it'd be: var clauses = new Array; then clauses[clauses.length] = <a clause> clauses[clauses.length] = <a nuther clause> Where a tolerance is needed (e.g. on age) you'd deal with it at this time, so the clause going into the array looks like: "((age >= 27) and (age <= 33))" for a +/- 3 year tolerance. Once you've finished with the form, you've got an array full of clauses. Now al you've got to do is construct the SQL. Buzz through the array and create the string. Indeed, in JScript you could do it in one step: SQL = ..... + clauses.join (" and ") + ... Don't know about the equivalent statements in VBScript, but I assume extensible arrays and join facilities exist. You can also check the length of the clauses array to make sure that the enquiry includes at least something to check on - indeed, you'd probably insist on at least a length of 3 to make sure you had some shot at reducing the size of the record set. You can do the same thing with string concatenation, of course, but this one seems to cry out for an array. HTH Dave S ----- Original Message ----- From: "Dian Chapman" <[EMAIL PROTECTED]> To: "Group - ASP" <[EMAIL PROTECTED]> Sent: Thursday, August 26, 2004 12:22 PM Subject: [ASP] Multi Criteria Searches > Hi folks... > > I've volunteered to help a Missing Persons site get their stuff back online > (after their previous dev demanded money and then bailed<sigh>). > > Most shouldn't be too difficult...just a lot of grunt work. However, there > will be one complex search pages for which I'm not quite sure how to > handle. This being for an actual missing or found person match...for which > there can be a pile of items that folks will attempt to match to narrow > their search. > > Say someone tries searching the "Doe" DB to see if their missing person > matches someone who was found, yet unidentified. They might attempt to match > several criteria such as: > > * male > * 45 yrs > * missing city > * with various traits > > Possibly several other specific details. Most all the fields are individual > ones, although the distinguishing marks fields is a memo field! > > Anyone have a clue on how this should be handled, outside of a huge > ...OR...statement??? > > TIA for any info... > > Dian ~ --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.740 / Virus Database: 494 - Release Date: 16/08/2004 --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [EMAIL PROTECTED] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.742 / Virus Database: 495 - Release Date: 8/19/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.742 / Virus Database: 495 - Release Date: 8/19/2004 ------------------------ Yahoo! Groups Sponsor --------------------~--> $9.95 domain names from Yahoo!. Register anything. http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/17folB/TM --------------------------------------------------------------------~-> --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [EMAIL PROTECTED] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
