Text matching in Query design. (1 Viewer)

sja13

Professional Idiot
Local time
Today, 09:01
Joined
May 3, 2017
Messages
63
There's probably a frustratingly simple answer to this one, but I'm trying (and failing) to use a Query to locate one or more records in a Table where a field in that Table has the value "X:\GKD\Photos\Awaiting Image.jpg".
Because I know that the text has a blank in it, in the Query Builder's "Criteria" box I've tried
  • just entering the text without quotes (the system inserts front and end quotes) - No records found.
  • Enclosing the file name and path in single quotes (e.g. 'X:\GKD..... .jpg' - the system adds front and end double quotes - No records found.
  • Adding double double quotes (e.g. """X:\GKD\.... .jpg""" (the system leaves the criteria "as is") - No records.

Other info
As i'm developing the Db, the Table in question only has 1 record, which DOES match the Criteria (I used cut-n-paste to be certain).

Any ideas?
 

isladogs

MVP / VIP
Local time
Today, 09:01
Joined
Jan 14, 2017
Messages
18,261
There's probably a frustratingly simple answer to this one, but I'm trying (and failing) to use a Query to locate one or more records in a Table where a field in that Table has the value "X:\GKD\Photos\Awaiting Image.jpg".
Because I know that the text has a blank in it, in the Query Builder's "Criteria" box I've tried
  • just entering the text without quotes (the system inserts front and end quotes) - No records found.
  • Enclosing the file name and path in single quotes (e.g. 'X:\GKD..... .jpg' - the system adds front and end double quotes - No records found.
  • Adding double double quotes (e.g. """X:\GKD\.... .jpg""" (the system leaves the criteria "as is") - No records.

Other info
As i'm developing the Db, the Table in question only has 1 record, which DOES match the Criteria (I used cut-n-paste to be certain).

Any ideas?

Apart from the obvious comment of renaming the image file you mean!
Have you tried square brackets! Or using %20 instead of the space?

EDIT:
I just created a table with 3 records



I then ran this query & it correctly found record 1

Code:
SELECT Table1.ID, Table1.FileName
FROM Table1
WHERE (((Table1.FileName)='X:\GKD\Photos\Awaiting Image.jpg'));

So no reason I can see why it doesn't work for you
 

Attachments

  • Table.PNG
    Table.PNG
    6.6 KB · Views: 168
Last edited:

sja13

Professional Idiot
Local time
Today, 09:01
Joined
May 3, 2017
Messages
63
ridders - I agree it should work.
Attached are three screenshots, showing the Table, the Query Design, and the Query Result.
I'm still baffled!
 

Attachments

  • QP1 Table.jpg
    QP1 Table.jpg
    60.3 KB · Views: 120
  • QP2 Query Design view.jpg
    QP2 Query Design view.jpg
    81 KB · Views: 107
  • QP3 Query Datasheet view.jpg
    QP3 Query Datasheet view.jpg
    60 KB · Views: 78

isladogs

MVP / VIP
Local time
Today, 09:01
Joined
Jan 14, 2017
Messages
18,261
Wild guess. Do you have a trailing space after jpg
 

sja13

Professional Idiot
Local time
Today, 09:01
Joined
May 3, 2017
Messages
63
Can't find a trailing space.
Tried replacing space in criteria with %20% - still no hit.
Am I being dim? What did you mean by
Apart from the obvious comment of renaming the image file you mean
?
 

isladogs

MVP / VIP
Local time
Today, 09:01
Joined
Jan 14, 2017
Messages
18,261
It was a slightly flippant comment that you could just remove the space in the file name ....

I'm out of ideas otherwise.
You could upload the db & I'll see if there's something I can spot...
 

isladogs

MVP / VIP
Local time
Today, 09:01
Joined
Jan 14, 2017
Messages
18,261
Oh I've just seen the reason .....:D

Look carefully at your image path in the table and in your query design.
They are different!
Extra photos folder added!
 

sja13

Professional Idiot
Local time
Today, 09:01
Joined
May 3, 2017
Messages
63
ridders....

Whilst "sanitising" the Db to upload it, I noticed the same fault you'd found.

Thanks anyway for all the replies!

I now officially qualify for the world famous "Numb as a Brush Gold Plated Time Wasters" award.

(Trouble is, I'm sure I'm a five times recipient!) :banghead:
 

isladogs

MVP / VIP
Local time
Today, 09:01
Joined
Jan 14, 2017
Messages
18,261
You're welcome.
The simplest things can be the hardest to see ...
Perhaps on this occasion, you earned the byline under your name! :rolleyes:
But we've all done things like that :)
 

Users who are viewing this thread

Top Bottom