John,
Actually there are no brackets - I wonder why I added them when replying to your post.
Yes you are right, it seems still good if 'a' is removed from LastName1.
Ozair.
--- In MS_Access_Professionals@yahoogroups.com, John Viescas <JohnV@...> wrote:
>
> Ozair-
>
> I wouldn't bother adding 'a' to LastName1. I'm not sure I understand the
> brackets - is the query engine processing that as a predicate and not a
> parameter?
>
> John Viescas, Author
> Microsoft Access 2010 Inside Out
> Microsoft Access 2007 Inside Out
> Microsoft Access 2003 Inside Out
> Building Microsoft Access Applications
> SQL Queries for Mere Mortals
> http://www.viescas.com/
> (Paris, France)
>
>
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Ozair
> Sent: Wednesday, May 22, 2013 11:40 PM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: Re: [MS_AccessPros] using Between in Query for String values
>
> John,
>
> Thank you very much.
>
> Based on your input, I altered my WHERE clause like this...
> [Between '" & Me.LastName1 & "a' And '" & Me.LastName2 & "z']
>
>
> Ozair.
>
> --- In MS_Access_Professionals@yahoogroups.com, John Viescas <JohnV@>
> wrote:
> >
> > Ozair-
> >
> > When you use BETWEEN, the query engine evaluates it like:
> >
> > WHERE LastName >= 'ca*' AND LastName <= 'co*'
> >
> > In other words, it doesn't evaluate the literal using LIKE, so the *
> > is simply another character.
> >
> > Try using BETWEEN 'ca' AND 'cozzzzzz'
> >
> > When I search for your account online, it shows only one account
> > registered to Yahoo ID "ozairkhalidozair" - set to receive the Daily
> > Digest. I can change that for you, or you can change it yourself. Go
> > to the group website and click Edit Membership near the top left of
> > the page. Note that Yahoo will occasionally ask you to login again.
> >
> > John Viescas, Author
> > Microsoft Access 2010 Inside Out
> > Microsoft Access 2007 Inside Out
> > Microsoft Access 2003 Inside Out
> > Building Microsoft Access Applications SQL Queries for Mere Mortals
> > http://www.viescas.com/ (Paris, France)
> >
> >
> >
> >
> > -----Original Message-----
> > From: MS_Access_Professionals@yahoogroups.com
> > [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Ozair
> > Sent: Tuesday, May 21, 2013 2:29 AM
> > To: MS_Access_Professionals@yahoogroups.com
> > Subject: [MS_AccessPros] using Between in Query for String values
> >
> >
> > Hello,
> >
> > SELECT dbo_T_People.LastName FROM dbo_T_People WHERE
> > (((dbo_T_People.LastName) Between 'ca*' And 'co*')) ORDER BY
> > dbo_T_People.LastName DESC;
> >
> > The above query did not return many names which exist in the table.
> > For example...
> > LastName
> > Cowgill
> > Cowett
> > Cowen
> > cowell
> > Cowdrey
> > Cowart
> > Cowan
> > Covolo
> > Covington
> >
> > HOWEVER if I alter the query [Between 'ca*' And 'cp*'] the missing
> > records do show up.
> >
> > Please help and explain.
> >
> > Regards,
> > Ozair
> >
> > P.S. When I tried to post this question, I had been asked to "Join
> > Group" ( I think I am already a member - still getting Daily Digest emails
> ).
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (6) |
Tidak ada komentar:
Posting Komentar