Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 15th, 2004, 06:33 PM
kurtblaze kurtblaze is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 kurtblaze User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Create LIKE query in Access

I am just beginning to learn Access, and I am trying to create a query to look up part numbers, and I can't get the "LIKE" statement to work correctly.

SQL View

SELECT *
FROM KnobInventory
WHERE (((KnobInventory.PartNo) LIKE [Enter Part No]));


I don't know how to create the variable to put in the LIKE '*VAR*' part of the query.

Thanks in advance for any help.

Reply With Quote
  #2  
Old June 17th, 2004, 06:13 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
If your part number is a string, you will need single quotes around [Enter Part No] - you don't need all the parenthesis either. A LIKE statement also usually contains a wildcard character (%), but I think Access uses an asterisk (*).

The Access help is actaully pretty good for these kind of queries (lookup "Like Operator") - I suggest looking there first.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old June 25th, 2004, 12:56 PM
schroederwallac schroederwallac is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 7 schroederwallac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 0
Arrow Like qry

SELECT *
FROM KnobInventory
WHERE (((KnobInventory.PartNo) LIKE "*" & [Enter Part No] & "*"));

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Create LIKE query in Access


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
Stay green...Green IT