Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Running a query for Invoices that start with 5

Geek News

Running a query for Invoices that start with 5
"mugziegumz via AccessMonster.com" <u47747[ at ]uwe> 12/10/2008 1:44:36 PM
How do I create a query that will look up multiple invoices that start with
the number 5? When I type in criteria "5" nothing shows up even though I know
I have plenty.....thanks.
Shannon

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200812/1

RE: Running a query for Invoices that start with 5
Dale Fye 12/10/2008 4:55:01 PM
Is your invoice # numeric or string?

If numeric then try:

WHERE left(cstr([Invoice]), 1) = "5"

or you could use:

WHERE cstr([Invoice]) like "5*"

If the field is a string, then you don't need to do the conversion, so:

WHERE [Invoice] like "5*"

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



"mugziegumz via AccessMonster.com" wrote:

[Quoted Text]
> How do I create a query that will look up multiple invoices that start with
> the number 5? When I type in criteria "5" nothing shows up even though I know
> I have plenty.....thanks.
> Shannon
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200812/1
>
>
Re: Running a query for Invoices that start with 5
John W. Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 12/10/2008 5:50:12 PM
On Wed, 10 Dec 2008 13:44:36 GMT, "mugziegumz via AccessMonster.com"
<u47747[ at ]uwe> wrote:

[Quoted Text]
>How do I create a query that will look up multiple invoices that start with
>the number 5? When I type in criteria "5" nothing shows up even though I know
>I have plenty.....thanks.

A criterion of "5" will show all invoices where the field is exactly equal to
the text string "5".

To get "starting with" use the LIKE operator and the wildcard *, which matches
any string: a criterion of

LIKE "5*"

--

John W. Vinson [MVP]

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net