SunQuest
           MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old April 27th, 2004, 04:29 AM
Kimppa Kimppa is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: Finland
Posts: 706 Kimppa User rank is Sergeant (500 - 2000 Reputation Level)Kimppa User rank is Sergeant (500 - 2000 Reputation Level)Kimppa User rank is Sergeant (500 - 2000 Reputation Level)Kimppa User rank is Sergeant (500 - 2000 Reputation Level)Kimppa User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 18 h 5 m 46 sec
Reputation Power: 15
Wildcard in where clause

I'm making a program with VB 6 and using ms access as database.
I'm having a small problem with a query, so I was wondering if it's possible to have a wildcard in the where clause, like this

"SELECT * FROM mytable WHERE mytable.* LIKE '" & keywords.TEXT & "'"

I tried that one but it didn't work. I could of course separate all table columns and make their own LIKE-condition for each and every column, like this....

"SELECT * FROM mytable WHERE product LIKE '" & keywords.TEXT & "' OR product_name LIKE '" & keywords.TEXT & "'.... etc


... but I'd rather find a way to use the wildcard thing.

All ideas are welcome.

Thank you in advance

- Kimppa
__________________
Fatal error on row 561: Couldn't access life - life isn't set

Reply With Quote
  #2  
Old April 27th, 2004, 07:16 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 25th Plane (17000 - 17499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,149 r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 4 Days 14 h 39 m 56 sec
Reputation Power: 883
you cannot use a wildcard for the columns in a WHERE clause

you need the LIKE condition on each column separately

don't forget your wildcard character, which is * for Access

also, please post Access questions into the Database Management forum next time, this is the SQL Server forum
__________________
r937.com | rudy.ca

Reply With Quote
  #3  
Old April 28th, 2004, 12:08 AM
Kimppa Kimppa is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: Finland
Posts: 706 Kimppa User rank is Sergeant (500 - 2000 Reputation Level)Kimppa User rank is Sergeant (500 - 2000 Reputation Level)Kimppa User rank is Sergeant (500 - 2000 Reputation Level)Kimppa User rank is Sergeant (500 - 2000 Reputation Level)Kimppa User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 18 h 5 m 46 sec
Reputation Power: 15
Thanks...
And sorry for the wrong forum, didn't even notice it myself :-)

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Wildcard in where clause


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway