Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2007, 01:59 PM
Registered User
 
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default string compare in table field

I have a field in a database called categories with values separated by commas, example.
Arts,Education,Sports,Poetry
This field was saved into the table thourgh a list box selection element.
now in my application the user selects values from a list box and those values are compare to the database field categories. If one of those values selected in the search appears in the categories field that row is selected for display. example

eventID Categories
13 Arts,Sports,Poetry
14 Sports,Poetry,Lecture,Math
15 Arts,Religion,Math,Geography
16 Sports,Poetry,Lecture,History


In application user selects from list box:
Arts,Religion,History

so the records to return are:
13 15 16

currently my application is accepting one value from the list box and it works fine, i am using the '%like with wildcard%' option, but I need to pass and compare multiple values.

 
Old April 27th, 2007, 12:25 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Asked and answered here already
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=82713







Similar Threads
Thread Thread Starter Forum Replies Last Post
compare form field to database before submit chelle60 Javascript How-To 3 January 2nd, 2007 05:42 AM
Compare only the date portion of a datetime field CricketMaster Access 6 April 27th, 2005 01:06 AM
Compare FE table with same BE version of table amerk20 Access VBA 5 November 29th, 2004 04:51 PM
Urgent help needed! Compare a string to Sysdate in WroteForLuck Classic ASP Professional 1 July 17th, 2003 06:11 PM
How to compare a string with the & sign in it? apd8x Javascript 3 June 13th, 2003 02:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.