|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
SELECT *
FROM KnobInventory WHERE (((KnobInventory.PartNo) LIKE "*" & [Enter Part No] & "*")); |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Create LIKE query in Access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|