1a206 Filter based on first character of field
Sign Up |  Live StatsLive Stats    Articles 37,314| Comments 177,065| Members 19,399, Newest hsingh777| Online 502
Home Contact
 (Forgotten?): 
    Sikhism
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Sikh Philosophy Network » Sikh Philosophy Network » Current News » Information Technology » Filter based on first character of field

Filter based on first character of field

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 100 USD (20%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
Calculate field based on many side field value Martino165 Information Technology 1 28-Jul-2006 08:21 AM
Update/lookup value of one field based upon entry in previous field stevewrite@gmail.com Information Technology 2 28-Jul-2006 08:18 AM
Auto fill in field 2 based on field 1 panjo Information Technology 1 28-Jul-2006 08:16 AM
Making a field required based on a different field dmv1947 Information Technology 1 28-Jul-2006 08:14 AM
Look up based on another field graffbp Information Technology 1 28-Jul-2006 08:09 AM


Tags
filter, based, first, character, field
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:36 AM
Francophone's Avatar Francophone
Guest
 
Posts: n/a
   
   
Filter based on first character of field

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
I need to perform a query where it picks out records only if the first
character of (ie. Part number) is a letter. How do I put this in a criteria?
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/13350-filter-based-on-first-character-field.html

TIA

*







Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:36 AM
Nikos Yannacopoulos's Avatar Nikos Yannacopoulos
Guest
 
Posts: n/a
   
   
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
Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:36 AM
Tom Wickerath's Avatar Tom Wickerath
Guest
 
Posts: n/a
   
   
RE: Filter based on first character of field

Here is one method:

SELECT tblPartsData.[Part number]
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350
FROM tblPartsData
WHERE IsNumeric(Left([Part number],1))=-1;


where "tblPartsData" is the name of the table, and [Part number] is the name
of the field. Make the appropriate substitutions.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/ex...tributors.html
http://www.access.qbuilt.com/html/search.html
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350
__________________________________________

"Francophone" wrote:

> I need to perform a query where it picks out records only if the first
> character of (ie. Part number) is a letter. How do I put this in a criteria?
>
> TIA

Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:36 AM
Tom Wickerath's Avatar Tom Wickerath
Guest
 
Posts: n/a
   
   
RE: Filter based on first character of field

Oops. I misread your question. Change the criteria I used to = 0, if you want
to use my previous suggestion:
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350

SELECT tblPartsData.[Part number]
FROM tblPartsData
WHERE IsNumeric(Left([Part number],1))=0;


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/ex...tributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________


Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13350
"Tom Wickerath" wrote:

> Here is one method:
>
> SELECT tblPartsData.[Part number]
> FROM tblPartsData
> WHERE IsNumeric(Left([Part number],1))=-1;
>
>
> where "tblPartsData" is the name of the table, and [Part number] is the name
> of the field. Make the appropriate substitutions.
>
>
> Tom Wickerath
> Microsoft Access MVP
>
> http://www.access.qbuilt.com/html/ex...tributors.html
> http://www.access.qbuilt.com/html/search.html
> __________________________________________
>
> "Francophone" wrote:
>
> > I need to perform a query where it picks out records only if the first
> > character of (ie. Part number) is a letter. How do I put this in a criteria?
> >
> > TIA

Reply With Quote
  #5 (permalink)  
Old 28-Jul-2006, 08:36 AM
Nikos Yannacopoulos's Avatar Nikos Yannacopoulos
Guest
 
Posts: n/a
   
   
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
Reply With Quote
  #6 (permalink)  
Old 28-Jul-2006, 08:36 AM
Tom Wickerath's Avatar Tom Wickerath
Guest
 
Posts: n/a
   
   
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.html
Reference:: 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
>

Reply With Quote
  #7 (permalink)  
Old 28-Jul-2006, 08:37 AM
Nikos Yannacopoulos's Avatar Nikos Yannacopoulos
Guest
 
Posts: n/a
   
   
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=13350
Reference:: 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,
Reply With Quote
  #8 (permalink)  
Old 28-Jul-2006, 08:37 AM
Nikos Yannacopoulos's Avatar Nikos Yannacopoulos
Guest
 
Posts: n/a
   
   
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
Reply With Quote
  #9 (permalink)  
Old 28-Jul-2006, 08:37 AM
Tom Wickerath's Avatar Tom Wickerath
Guest
 
Posts: n/a
   
   
Re: Filter based on first character of field

  Donate Today!  
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,

Reply With Quote
   Click Here to Donate Now!

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!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(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
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
30 Day Amrit Vel 'a'...
Today 20:06 PM
4 Replies, 19 Views
Should SPN Keep the...
Today 19:48 PM
17 Replies, 438 Views
Map shows world's 'most...
Today 18:58 PM
16 Replies, 253 Views
What I believe Hukam to...
Today 18:26 PM
2 Replies, 34 Views
Thought of the Moment!
Today 13:33 PM
107 Replies, 5,050 Views
Do you believe in...
Today 13:15 PM
180 Replies, 3,748 Views
BHOOTS (Ghosts) and...
Today 13:08 PM
102 Replies, 13,868 Views
What Do You Think of...
By akiva
Today 12:56 PM
27 Replies, 554 Views
How does Sikhi help you...
Today 12:44 PM
17 Replies, 583 Views
Why are There so Many...
Today 10:23 AM
70 Replies, 5,031 Views
Biography of a Scholar:...
Today 06:10 AM
1 Replies, 63 Views
Of Serpents, Pigs,...
Today 05:21 AM
37 Replies, 1,025 Views
Friends. A Testimony to...
Today 02:40 AM
4 Replies, 112 Views
Panjabi
Today 02:27 AM
11 Replies, 238 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 02:13 AM
301 Replies, 7,462 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 20:16 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.70496 seconds with 32 queries
0