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 August 2nd, 2004, 08:14 AM
Icerat Icerat is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 Icerat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrow Like queries

Hi all
I have a database that lists stock and each stock type has a unique InternalID like the following:

D
DM
M
MS
MP
N
KA
KP
HD
PR
S
CD
G

The codes were set for the stock before the database was built so they cant be changed.

I have a count query that is based on the results of a query that searches for a specific stock type and weather or not its been sold, the problem I’m having is that when I query the db for all stock with the internal ID of D I get the DM stock in the query also. I’ve been using:

SELECT [tbl_stock/equipment].EquipID, [tbl_stock/equipment].InternalID, [tbl_stock/equipment].Sold
FROM [tbl_stock/equipment]
WHERE ((([tbl_stock/equipment].InternalID) Like "D***") AND (([tbl_stock/equipment].Sold)=0));

How can I just get the D code and not the DM code in the query results (See 5qur_unsold_bases)?

Thanks

Mike

Sample DB Attached
Attached Files
File Type: zip testdb.zip (63.9 KB, 301 views)

Reply With Quote
  #2  
Old August 2nd, 2004, 03:53 PM
ineuw ineuw is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 82 ineuw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 28 sec
Reputation Power: 5
It's easy use = "D" or
Like "D?" for an additoonal one character.
I will check your database and get back to you in about 2 hours. The time now is it's 5pm EST

Reply With Quote
  #3  
Old August 2nd, 2004, 04:47 PM
ineuw ineuw is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 82 ineuw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 28 sec
Reputation Power: 5
Here is your solution:

SELECT [tbl_stock/equipment].EquipID, [tbl_stock/equipment].InternalID, [tbl_stock/equipment].Sold FROM [tbl_stock/equipment] WHERE ((([tbl_stock/equipment].InternalID) Like "D?") AND (([tbl_stock/equipment].Sold)=0));

However, I didn't find a stock ID With a single character liek "D"

The Like operator can be manipulated with "D??" which would list you "M" codes.

I hope this helps.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Like queries


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 1 hosted by Hostway