query problem

  • Thread starter Thread starter fishberry
  • Start date Start date
F

fishberry

I have a table(sentences) which has two columns:
Indexnumber,Sentence.Sentence column contains a lot of English sentences. I
want to select all sentences which contain question mark.
I use sql:
select *
from sentences
where sentence Like "%?%"
But it doesn't work.
 
Try,

SELECT Sentences.*
FROM Sentences
WHERE (((Sentences.Sentence) Like "*?*"));

Regards,

ET Sherman
 
I want to select all sentences which contain question mark.
I use sql:
select *
from sentences
where sentence Like "%?%"
But it doesn't work.

It doesn't work because ? is a wildcard character, matching any single
character. In addition, the "any string of characters" wildcard in
Access (unlike SQL) is *. You will need to put the question mark in
square brackets:

WHERE sentence LIKE "*[?]*"
 
Back
Top