Simple Query Not Working

  • Thread starter Thread starter Michael DiCostanzo
  • Start date Start date
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??
 
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.
 
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.
 
Back
Top