 | 
28-Jul-2006, 08:36 AM
|  | Guest | | | | | | | | | | Re: Filter based on first character of field One way is to use a criterion like:
(>="A*" And <="Z*") Or (>="a*" And <="z*")
if you want both upper and lower case, or just the first part if you
only want upper case. Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350
HTH,
Nikos | 
28-Jul-2006, 08:36 AM
|  | Guest | | | | | | | | | | Re: Filter based on first character of field Tom,
Strictly speaking, this filters out non-numeric first characters, but
lets through other symbols printable characters like !@#$%^&*()_?>< etc, Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350
whereas the OP needs to filter through letters only.
Nikos | 
28-Jul-2006, 08:36 AM
|  | Guest | | | | | | | | | | Re: Filter based on first character of field Hi Nikos,
You are correct. Okay, how about this version?
SELECT tblPartsData.[Part number]
FROM tblPartsData
WHERE Asc(Left([Part number],1)) Between 65 And 90 Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350
Or Asc(Left([Part number],1)) Between 97 And 122
PS. On your submission, this part seems to be incorrect:
"or just the first part if you only want upper case."
Tom Wickerath
Microsoft Access MVP http://www.access.qbuilt.com/html/ex...tributors.html http://www.access.qbuilt.com/html/search.htmlReference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350
__________________________________________
"Nikos Yannacopoulos" wrote:
> Tom,
>
> Strictly speaking, this filters out non-numeric first characters, but
> lets through other symbols printable characters like !@#$%^&*()_?>< etc,
> whereas the OP needs to filter through letters only.
>
> Nikos
> | 
28-Jul-2006, 08:37 AM
|  | Guest | | | | | | | | | | Re: Filter based on first character of field Tom,
This is the way I would have done it in VBA. I proposed the other
approach because, while functionally equivalent, it fits right in the
criterion line in the query design grid, without the need for calculated Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350
fields... so my answer would be as close as possible to the original
question "How do I put this in a criteria".
I had no doubt you knew how to do it, just posted my comment for the
benefit of less experienced readers.
Kind regards, | 
28-Jul-2006, 08:37 AM
|  | Guest | | | | | | | | | | Re: Filter based on first character of field Hi again Tom,
I was puzzled for a minute by your PS, then I realized the proposed
filtering is not case-sensitive, so just:
>="A*" And <="Z*"
would have done it. I think I had your solution in the back of my mind Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350
(because I've used it repeatedly), and trying to put that in a criterion
line, I guess...
Thanks for straightening this out. Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350
Kind regards,
Nikos | 
28-Jul-2006, 08:37 AM
|  | Guest | | | | | | | | | | Re: Filter based on first character of field Hi Nikos,
> I had no doubt you knew how to do it, just posted my comment for the Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350 Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350
> benefit of less experienced readers.
That's fine. Your method works perfectly good too. I specifically said "Here
is one method" because I know that there is more than one way to skin a cat
in this case. The problem I had is that I initially misinterpreted the
request, so I was looking for records that started with a number, not a
letter. I'm just more comfortable calling the IsNumeric function in that case
(which, as you've pointed out, is not required since we're looking for an
alpha character instead).
Tom Wickerath
Microsoft Access MVP http://www.access.qbuilt.com/html/ex...tributors.html http://www.access.qbuilt.com/html/search.html
__________________________________________
"Nikos Yannacopoulos" wrote:
> Tom,
>
> This is the way I would have done it in VBA. I proposed the other
> approach because, while functionally equivalent, it fits right in the
> criterion line in the query design grid, without the need for calculated
> fields... so my answer would be as close as possible to the original
> question "How do I put this in a criteria".
>
> I had no doubt you knew how to do it, just posted my comment for the
> benefit of less experienced readers.
>
> Kind regards, | 
Support Us! Become a Promoter! | | Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh! | (View-All)
Members who have read this thread : 0
| | There are no names to display. | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Tools | Search | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On | | | | » Active Discussions | | | | | | | | | | | | | | | | | | | | | | | | | | | Panjabi Today 02:27 AM 11 Replies, 238 Views | | | » Books You Should Read... | | | |