Home All Groups Group Topic Archive Search About
Author
27 Feb 2007 11:09 AM
musosdev
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

Author
27 Feb 2007 11:17 AM
musosdev
just to clarify, the "SoryTitle LIKE" should be "StoryTitle LIKE" - can't
spell today! :)

Show quote
"musosdev" wrote:

> 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
Author
27 Feb 2007 12:54 PM
Patrice
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 ?

"musosdev" <musoswire@community.nospam> a écrit dans le message de news:
4D29C067-CD97-4A9C-8C65-13EC9CB60***@microsoft.com...
Show quote
> just to clarify, the "SoryTitle LIKE" should be "StoryTitle LIKE" - can't
> spell today! :)
>
> "musosdev" wrote:
>
>> 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
Author
27 Feb 2007 1:25 PM
musosdev
Users submit stories, the story title they give might start with a number ('3
Little Pigs' ?)

Thanks, I'll try a BETWEEN :)

Show quote
"Patrice" wrote:

> 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 ?
>
> "musosdev" <musoswire@community.nospam> a écrit dans le message de news:
> 4D29C067-CD97-4A9C-8C65-13EC9CB60***@microsoft.com...
> > just to clarify, the "SoryTitle LIKE" should be "StoryTitle LIKE" - can't
> > spell today! :)
> >
> > "musosdev" wrote:
> >
> >> 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
>
>
>
Author
27 Feb 2007 4:33 PM
RobinS
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.
----------------------------------
Show quote
"musosdev" <musoswire@community.nospam> wrote in message
news:7F7F26B0-AC5D-4435-9507-64B7AE2D2A75@microsoft.com...
> Users submit stories, the story title they give might start with a number
> ('3
> Little Pigs' ?)
>
> Thanks, I'll try a BETWEEN :)
>
> "Patrice" wrote:
>
>> 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 ?
>>
>> "musosdev" <musoswire@community.nospam> a écrit dans le message de news:
>> 4D29C067-CD97-4A9C-8C65-13EC9CB60***@microsoft.com...
>> > just to clarify, the "SoryTitle LIKE" should be "StoryTitle LIKE" -
>> > can't
>> > spell today! :)
>> >
>> > "musosdev" wrote:
>> >
>> >> 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
>>
>>
>>
Author
28 Feb 2007 9:10 AM
WenYuan Wang
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
Author
28 Feb 2007 10:28 AM
Patrice
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

"musosdev" <musoswire@community.nospam> a écrit dans le message de news:
7F7F26B0-AC5D-4435-9507-64B7AE2D2***@microsoft.com...
Show quote
> Users submit stories, the story title they give might start with a number
> ('3
> Little Pigs' ?)
>
> Thanks, I'll try a BETWEEN :)
>
> "Patrice" wrote:
>
>> 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 ?
>>
>> "musosdev" <musoswire@community.nospam> a écrit dans le message de news:
>> 4D29C067-CD97-4A9C-8C65-13EC9CB60***@microsoft.com...
>> > just to clarify, the "SoryTitle LIKE" should be "StoryTitle LIKE" -
>> > can't
>> > spell today! :)
>> >
>> > "musosdev" wrote:
>> >
>> >> 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
>>
>>
>>
Author
2 Mar 2007 7:15 AM
WenYuan Wang
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
Author
6 Mar 2007 8:43 AM
WenYuan Wang
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

AddThis Social Bookmark Button