Simple Query Not Working

M

Michael DiCostanzo

I have a table with three fields:

DeviceCondition (dcID, devID, condID)

dcID is the PK for this table. devID and conID are the primary keys
for their respective tables, Devices and Conditions.

Some of my query results looked odd, so I ran a simple query on the
DeviceCondition table. When I run the following queries:

SELECT DeviceCondition.dcID, DeviceCondition.devID,
DeviceCondition.condID
FROM DeviceCondition
WHERE (((DeviceCondition.condID)="D12.5"));

or

SELECT DeviceCondition.dcID, DeviceCondition.devID,
DeviceCondition.condID
FROM DeviceCondition
WHERE (((DeviceCondition.dcID)=9));

I get the correct results.

When I run this query, I get no results back when I should get four
records.

SELECT DeviceCondition.dcID, DeviceCondition.devID,
DeviceCondition.condID
FROM DeviceCondition
WHERE (((DeviceCondition.devID)="D140"));

What am I missing here??
 
H

hcj

Hi Michael,
Is it possible one or more spaces have slipped into the
field? Try criterion *D140* to see if your records come
up.

Hope this helps.
 
M

Michael DiCostanzo

Thanks for your response.

As is always the case, within a couple of hours after submitting this
post, I found the problem. The field in question was referencing a
different table and I had deleted the relationship because that table
was no longer needed. I changed the reference and then everything
worked OK.

It's a classic case of keeping is simple. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top