PDA

View Full Version : SQL string fails to return all items?



JapanDave
07-13-2012, 06:51 PM
I am using Excel for access front end. When I run a SQL query it pulls about a 1000 lines of data, but fails to get just one line. I checked to make sure the criteria matched for that piece of data and it does. Why would something like this happen?

hansup
07-14-2012, 08:28 AM
If the query criteria references a text field, check whether the field value includes characters which are not visible.

So if "dog" is displayed in field_name, but Len(field_name) reports 4 (or more), field_name includes a stored character you weren't expecting.

JapanDave
07-14-2012, 11:27 AM
If the query criteria references a text field, check whether the field value includes characters which are not visible.

So if "dog" is displayed in field_name, but Len(field_name) reports 4 (or more), field_name includes a stored character you weren't expecting.
The problem is it picks up that feid name for that particular item in other months. I am pulling data for a particular time period and it gets the the exact same items for other months, just in one case it does not. I tried replacing the data in the DB with the other months data to make sure the criteria matches with no success.

JapanDave
07-14-2012, 11:46 AM
BTW, running a query directly from the DB itself works no problem. Only when I try to pull data back to excel does this happen.