query question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

Is there a simpler/faster way of performing the following query with
AccessDataSource against an .MDB file?

SELECT StoryID, StoryTitle
FROM Stories
WHERE ((SoryTitle LIKE '0%') OR (SoryTitle LIKE '1%') OR (SoryTitle LIKE
'2%') OR(SoryTitle LIKE '3%') OR (SoryTitle LIKE '4%') OR (SoryTitle LIKE
'5%') OR (SoryTitle LIKE '6%') OR (SoryTitle LIKE '7%') OR (SoryTitle LIKE
'8%') OR (SoryTitle LIKE '9%'))

Thanks,


Dan
 
Looks like you could also try StoryTitle BETWEEN '0' AND '9'....

Not sure what is the meaning of having a value as the first character in a
title ?
 
Users submit stories, the story title they give might start with a number ('3
Little Pigs' ?)

Thanks, I'll try a BETWEEN :)
 
I think that would be
WHERE Left(StoryTitle,1) BETWEEN 0 and 9

You might have to do this:
WHERE Cint(Left(StoryTitle, 1)) BETWEEN 0 and 9

Robin S.
----------------------------------
 
Hi Dan,

Additionly, you can try
WHERE SoryTitle like '[0-9]%'

Hope this helps. Please feel free to let us know if there is anything we
can help with.

Have a great day.
Sincerely,
Wen Yuan
 
Not sure what is the overall goal but if this is to filter stories that are
not beginning with a letter (because you already have a A to Z UI filtering
mechanism) you could perhaps tell what you don't want rather than what you
want.

For example if a user entered a space or anything other than a letter or a
number as the first letter in the title (/+* or whatever else) the UI would
then never find this title.

If you filter on A, B ...Z and keep an option for anything other than A to Z
than you'll be able to view all titles...

Patrice
 
Hi Dan,

Just want to check if the issue has been resolved.
Please feel free to let me know if you have any futher question.

Have a great day,
Sincerely,
Wen Yuan
 
Hi Dan,

Just want to check if this issue has been resolved. Please feel free to let
me know if you have any further question. I'm glad to assist you.

Have a great day,
Sincerely,
Wen Yuan
 
Back
Top