navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Drop-down menus and multiple selection

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Drop-down menus and multiple selection
Page: [1]
 
Wendy P

 

Posts: 17
From: Timmins, Ontario, Canada
Status: offline

 
Drop-down menus and multiple selection - 10/3/2001 13:37:00   
Greetings All,

Does anyone know how to create a query based on multiple selections from a drop-down menu?

I can get it to work using the SELECT...IN(: ropBoxName: syntax for a series of numeric selections, however, if the selections are text based, I can't get the query to work.

Any thoughts?

Mojo

 

Posts: 2441
From: Chicago
Status: offline

 
RE: Drop-down menus and multiple selection - 10/3/2001 22:57:00   
What does your SQL statement look like?

Joe


(in reply to Wendy P)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Drop-down menus and multiple selection - 10/4/2001 20:44:00   
If its text, youll need to trick it into adding quotations

eg the value is 'text' rather than text

Then your in will look like :

('text','text2')

------------------
§þððk¥
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!
VP-ASP Shopping cart


(in reply to Wendy P)
Wendy P

 

Posts: 17
From: Timmins, Ontario, Canada
Status: offline

 
RE: Drop-down menus and multiple selection - 10/4/2001 20:36:00   
I was trying to trick the DRW into accepting it as text, but I can't seem to figure out how to do it. The problem is that it uses the whole list ie "fred, harry, tom" as the item to search for, instead of "fred" then "harry" then "tom".

Been working on this one for days and there doesn't seem to be any documentation out there on how it can be accomplished.

Here is my SQL statement so far. The field of issue is txtIndicatoScaleEng. All the other fields work properly.

SELECT * FROM qryIndicatorModelForestCCFM WHERE (anMFID IN (::ModelForest: AND tblIndicator.anCCFMIndicatorGroup IN (::CriticalElement: AND anCriteriaID IN (::Criteria: AND anMFID IN (::Region: AND txtIndicatorNameEng LIKE '%::Name::%' AND moIndicatorApplicationEng LIKE '%::Application::%' AND moIndicatorReportEng LIKE '%::Reporting::%' ) AND txtIndicatorScaleEng IN ('%::Scale::%')


(in reply to Wendy P)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Drop-down menus and multiple selection - 10/4/2001 22:42:00   
Dont use quotes or % !

No : ('%::Scale::%')

Yes : (::Scale:


(in reply to Wendy P)
Wendy P

 

Posts: 17
From: Timmins, Ontario, Canada
Status: offline

 
RE: Drop-down menus and multiple selection - 10/7/2001 20:47:00   
Hi Spooky,

I've been able to get the DRW to accept text using the SELECT...IN statement as long as my variable is sent as (::scale: instead of ('::scale::') and I put my criteria in quotes ie 'test1', 'test2', 'test3'.

As long as I need to match the whole field, this works well. However, I need to wildcard the criteria as I'm looking for something in the field as oppose to matching the whole field. In other words I want to "like" the field instead of "=" the field but using the SELECT...IN process for series.

In your infinite wisdom, any thoughts on how to fool the DRW into doing this?

Thanks for your patience.


(in reply to Wendy P)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Drop-down menus and multiple selection - 10/7/2001 16:14:00   
Hi Wendy,
It doesnt really seem you need multiple selection then, or do you need both?

You cant do a LIKE of a comma delimited string, as it has commas in it

The only other way would be to use asp and construct the SQL string with a loop.

That way, you would end up with a "where column LIKE 'select1' OR column LIKE 'select2' OR column LIKE 'select3'...."

Normally the use of a dropdown box, means that you have valid entries which directly match the database entries.

You havent? or am I missing something?

------------------
§þððk¥
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!
VP-ASP Shopping cart


(in reply to Wendy P)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Drop-down menus and multiple selection
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts