If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Query Question Regarding Two Tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Nov 2002
Posts: 154
Question Query Question Regarding Two Tables

Let's say I have two tables, an Inventory Table and a Showroom table. Sometimes Inventory is used as a showroom display model and is transferred to a new Inventory batch with a dash and the showroom code after it. The showroom code is unfortunately a string and does not have a standard length. Is there a way to ask in a query to only show me Inventory that looks LIKE a showroom code (any showroom code). I have tried using LIKE and IN() to no success, and it seem like trying to make a criteria string in a function (Like *this* OR like *that* OR ...) never seems to work in the criteria box in the query builder(I'm sure that this has to do with LIKE being a reserved word and not text, so the criteria ends up looking for the word 'like'). I am down to doing my old standby of making a table by running through all Inventory with dashes and comparing that to all showrooms (my old friend Instr) and then creating a table but I wondered if there is some trick that I haven't run across to do this quicker and with greater elegance. I am using Access 2003. Thank you for your time and your replies.
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: May 2004
Location: New York State
Posts: 1,177
Like requires quotes, so if your showroom codes all contain "SR," you would say, for example,
Code:
WHERE IC Like "*SR*"
This would include all inventory that includes a showroom code, and exclude all those that don't.

Sam
Reply With Quote
  #3 (permalink)  
Old
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 12,059
just as an aside its a leetle odd to my way of thinking to have a showroom table and an inventory table, that idenfication can be achieved by having a single location column which identifies where an item is (it could be showroom, it coulkd be a warehouse, it could be on the back of a truck....
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: May 2004
Location: New York State
Posts: 1,177
Quote:
just as an aside its a leetle odd to my way of thinking to have a showroom table and an inventory table, that idenfication can be achieved by having a single location column which identifies where an item is (it could be showroom, it coulkd be a warehouse, it could be on the back of a truck....
... and if you only have two or three showrooms (as opposed to 10 or more), you don't even need a separate table for them. Just make a combobox, make the row source type "table/query", and type all the values right there in the row source. You can use the wizard for this. Put the selected location in a separate column in the table, not as a part of the inventory code.

Sam

Last edited by Sam Landy; 11-08-12 at 11:29. Reason: I'm continuing healdem's thought
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On