I have a table in a database that contains a text field. The text
field contains identifiers that consist of 7 alphanumeric characters,
such as GORKY, 99SST, and PT10A.
I am trying to run a query that will only display those identifiers
that have no numerical characters, so that, from the examples above,
only GORKY will show.
I apologize is this is an often-repeted request. I searched Google and
Google Groups, but couldn't seem to come up with a search term narrow
enough to find this.
Thanks.
Mark Kolber
Denver, Colorado
=============== ========
email? Remove ".no.spam" 8 4157
Hi,
Try the following (tested in Acc2000):
Select * from yourtable where YourTextField Like
"[a-z|A-z][a-z|A-z][a-z|A-z][a-z|A-z][a-z|A-z]"
Regards,
Bogdan
----------------------------------------------
Freelance programmer
"Mark Kolber" <ma************ *****@yahoo.com > wrote in message
news:gn******** *************** *********@4ax.c om... I have a table in a database that contains a text field. The text field contains identifiers that consist of 7 alphanumeric characters, such as GORKY, 99SST, and PT10A.
I am trying to run a query that will only display those identifiers that have no numerical characters, so that, from the examples above, only GORKY will show.
I apologize is this is an often-repeted request. I searched Google and Google Groups, but couldn't seem to come up with a search term narrow enough to find this.
Thanks.
Mark Kolber Denver, Colorado =============== ======== email? Remove ".no.spam"
Bogdan,
Please explain what the vertical bar dies.
Thanks!
Tom
"bzamfir" <bz*****@despam med.com> wrote in message
news:bo******** *****@ID-189962.news.uni-berlin.de... Hi,
Try the following (tested in Acc2000):
Select * from yourtable where YourTextField Like "[a-z|A-z][a-z|A-z][a-z|A-z][a-z|A-z][a-z|A-z]"
Regards, Bogdan
---------------------------------------------- Freelance programmer "Mark Kolber" <ma************ *****@yahoo.com > wrote in message news:gn******** *************** *********@4ax.c om... I have a table in a database that contains a text field. The text field contains identifiers that consist of 7 alphanumeric characters, such as GORKY, 99SST, and PT10A.
I am trying to run a query that will only display those identifiers that have no numerical characters, so that, from the examples above, only GORKY will show.
I apologize is this is an often-repeted request. I searched Google and Google Groups, but couldn't seem to come up with a search term narrow enough to find this.
Thanks.
Mark Kolber Denver, Colorado =============== ======== email? Remove ".no.spam"
Hi Bogdan,
Although your query works with the limited test data that Mark provided, it will only
identify those records that are all text with five characters. It doesn't work with less
than or greater than 5 characters, unless a number is present in positions # 1-5.
I recommend instead that each character be inspected to determine if the Identifier should
be included in the recordset. The example shown below uses a table that is named
"tblIdentifiers ". This table has two fields: ID (autonumber) and Identifier (Text).
1) Create a new module. Paste the following function into this module. Watch for word
wrap, especially in the comment present in the code:
Option Compare Database
Option Explicit
Function ContainsANumber (MyStr As Variant) As Integer
Dim i As Integer
Dim intAsc As Integer
If Not IsNull(MyStr) Then
For i = 1 To Len(MyStr)
intAsc = Asc(MyStr)
If intAsc >= 48 Then '>= "0"
If intAsc <= 57 Then '<= "9" If both conditions pass, then we found a number so
we can stop looking
ContainsANumber = 1
Exit Function
End If
End If
MyStr = Right(MyStr, Len(MyStr) - 1)
'Debug.Print MyStr
Next i
End If
End Function
2) Create a query by pasting this SQL clause:
SELECT tblItentifiers. ID, tblItentifiers. Identifier, ContainsANumber ([Identifier])
AS [Includes numbers in Identifier?]
FROM tblItentifiers;
Save the query and name it "qryDetermineIf IdentifierConta insANumber" (without the quotes,
of course).
3) Create another query that uses qryDetermineIfI dentifierContai nsANumber as its source of
data:
SELECT qryDetermineIfI dentifierContai nsANumber.ID,
qryDetermineIfI dentifierContai nsANumber.Ident ifier
FROM qryDetermineIfI dentifierContai nsANumber
WHERE
(((qryDetermine IfIdentifierCon tainsANumber.[Includes numbers in Identifier?])=0));
The first query simply determines if the Identifier includes a number and shows this data
in a calculated field. The second query includes a criteria = 0 (ie. no numbers in
Identifier). This method works with any length of text.
Tom
*************** *************** *************** *************** *************
"bzamfir" <bz*****@despam med.com> wrote in message
news:bo******** *****@ID-189962.news.uni-berlin.de...
Hi,
Try the following (tested in Acc2000):
Select * from yourtable where YourTextField Like
"[a-z|A-z][a-z|A-z][a-z|A-z][a-z|A-z][a-z|A-z]"
Regards,
Bogdan
----------------------------------------------
Freelance programmer
*************** *************** *************** *************** *************
"Mark Kolber" <ma************ *****@yahoo.com > wrote in message
news:gn******** *************** *********@4ax.c om...
I have a table in a database that contains a text field. The text
field contains identifiers that consist of 7 alphanumeric characters,
such as GORKY, 99SST, and PT10A.
I am trying to run a query that will only display those identifiers
that have no numerical characters, so that, from the examples above,
only GORKY will show.
I apologize is this is an often-repeted request. I searched Google and
Google Groups, but couldn't seem to come up with a search term narrow
enough to find this.
Thanks.
Mark Kolber
Denver, Colorado
=============== ========
email? Remove ".no.spam"
How about simply:
Select * from yourtable where YourTextField Not Like '*[1-9]*'
Herbert
"bzamfir" <bz*****@despam med.com> ¦b¶l¥ó
news:bo******** *****@ID-189962.news.uni-berlin.de ¤¤¼¶¼g... Hi,
Try the following (tested in Acc2000):
Select * from yourtable where YourTextField Like "[a-z|A-z][a-z|A-z][a-z|A-z][a-z|A-z][a-z|A-z]"
Regards, Bogdan
---------------------------------------------- Freelance programmer "Mark Kolber" <ma************ *****@yahoo.com > wrote in message news:gn******** *************** *********@4ax.c om... I have a table in a database that contains a text field. The text field contains identifiers that consist of 7 alphanumeric characters, such as GORKY, 99SST, and PT10A.
I am trying to run a query that will only display those identifiers that have no numerical characters, so that, from the examples above, only GORKY will show.
I apologize is this is an often-repeted request. I searched Google and Google Groups, but couldn't seem to come up with a search term narrow enough to find this.
Thanks.
Mark Kolber Denver, Colorado =============== ======== email? Remove ".no.spam"
Hi Herbert,
Your solution seems to be the best. It's fairly simple and it works!
Thanks
Tom
_______________ _______________ _______________
"Herbert Chan" <he*****@chan.c om> wrote in message news:bo******** *@rain.i-cable.com...
How about simply:
Select * from yourtable where YourTextField Not Like '*[1-9]*'
Herbert
Hi, Please explain what the vertical bar dies.
Sorry, you can forgot about them. Sometimes I simple forget Access is case
independent. It was intended to pick small letters and uppercases.
And you need 7 char fields, while I made for 5 (I didn't read your post very
carefully, just saw the examples, where was only five chars)
Look at the solution from Herbert, it is better.
Regards,
Bogdan Thanks!
Tom
"bzamfir" <bz*****@despam med.com> wrote in message news:bo******** *****@ID-189962.news.uni-berlin.de... Hi,
Try the following (tested in Acc2000):
Select * from yourtable where YourTextField Like "[a-z|A-z][a-z|A-z][a-z|A-z][a-z|A-z][a-z|A-z]"
Regards, Bogdan
---------------------------------------------- Freelance programmer "Mark Kolber" <ma************ *****@yahoo.com > wrote in message news:gn******** *************** *********@4ax.c om... I have a table in a database that contains a text field. The text field contains identifiers that consist of 7 alphanumeric characters, such as GORKY, 99SST, and PT10A.
I am trying to run a query that will only display those identifiers that have no numerical characters, so that, from the examples above, only GORKY will show.
I apologize is this is an often-repeted request. I searched Google and Google Groups, but couldn't seem to come up with a search term narrow enough to find this.
Thanks.
Mark Kolber Denver, Colorado =============== ======== email? Remove ".no.spam"
No problem!
I just started out on Access 2 months ago, and so I'm only capable of simple
stuff:-)
Happy using newsgroups! I've got a lot of help from here as well :-) and of
course also from groups.google.c om. it's a real big time saver.
herbert
"Tom Wickerath" <AO************ ***********@com cast.net> ¦b¶l¥ó
news:-6************** ******@comcast. com ¤¤¼¶¼g... Hi Herbert,
Your solution seems to be the best. It's fairly simple and it works!
Thanks Tom _______________ _______________ _______________
"Herbert Chan" <he*****@chan.c om> wrote in message
news:bo******** *@rain.i-cable.com... How about simply:
Select * from yourtable where YourTextField Not Like '*[1-9]*'
Herbert
On Sun, 9 Nov 2003 10:40:24 +0800, "Herbert Chan" <he*****@chan.c om>
wrote: Select * from yourtable where YourTextField Not Like '*[1-9]*'
I just =knew= it had to be simple. I knew about the wildcards and the
brackets, but couldn't figure out how to put them together properly.
Thank you Herbert and all of the others who replied!
Mark Kolber
Denver, Colorado
=============== ========
email? Remove ".no.spam" This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Safalra |
last post by:
The idea here is relatively simple: a java program (I'm using JDK1.4
if that makes a difference) that loads an HTML file, removes invalid
characters (or replaces them in the case of common ones like
Microsoft's 'smartquotes'), and outputs the file.
The problem is these files will be on disk, so the program won't have
the character encoding information from the server.
Questions:
|
by: Jonas Smithson |
last post by:
I recently read the claim somewhere that numerical entities (such as
—) have a speed advantage over the equivalent named entities
(such as —) because the numerical entity requires just a single
byte to be downloaded to the browser, while the named entity requires
one byte for each letter. (So in this case, it would presumably be one
byte vs. seven bytes.) I found this claim a little surprising -- I
would have thought *each* numeral...
|
by: addi |
last post by:
I'm looking to perform input validation on an HTML input text element;
specifically, I'm looking to prevent anything other than numerical
characters from being entered.
I've got it working just fine for English characters by using an
'onkeypress' event handler, where basically all that is done is a
regular expression check of the character represented by
window.event.keyCode against a string containing "0123456789".
The problem I'm...
|
by: Tim Meagher |
last post by:
I am using the XslTransform class in C#.net to output XML files that include
non-ascii Unicode characters such as the Greek capital letter theta U+0398.
I can easily outout the data as serialized UTF-8 by using the default
encoding of UTF-8; however, my customer wants any non-ascii characters
output as numerically-entity encoded characters, e.g. Θ (where 920 is
the decimal equivalent for hexadecimal 398). If I use the Saxon processor
or...
|
by: Giloosh |
last post by:
Hello i have been trying to figure out this problem for a very long
time now, and thought maybe its worth asking for some help.
I want to figure out if there is a way to create a field in a select
query that acts as a "COUNT" for the fields in the query.
No matter what order the rest of the fields will be it will always
remain in numerical order from 0+. Field one will be 1, field 2 will be
2, field 3 will be 3...etc.
The reason i...
| |
by: Marc Scheuner [MVP ADSI] |
last post by:
Folks,
I need to try and make sure that a given string is a valid numerical
value (not just int, or int32 - it could be float, decimal, what have
you). VB.NET has a neat "IsNumeric" function - too bad C# doesn't have
anything similar. Or does it??
I was thinking about trying to convert the string to Int32, but as I
mentioned - that alone won't be good enough, and I really don't want
to attempt a dozen conversions to find out - nor do...
|
by: Tim Meagher |
last post by:
I am using the XslTransform class in C#.net to output XML files that include
non-ascii Unicode characters such as the Greek capital letter theta U+0398.
I can easily outout the data as serialized UTF-8 by using the default
encoding of UTF-8; however, my customer wants any non-ascii characters
output as numerically-entity encoded characters, e.g. Θ (where 920 is
the decimal equivalent for hexadecimal 398). If I use the Saxon processor
or...
|
by: meditcakepbgt |
last post by:
halo..
i have this problem..
i have a query that have been derived from many tables and query.. and i want to transfer some of the value in the query to a specific cells in the microsoft excell..
the example of the query is as stated below
City ! Year ! Month ! Sales ! Revenue !
-------------------------------------------------------------------------
Bandung 2005 05 3851 987
|
by: thecheyenne |
last post by:
Dear all!
I have a database that stores student results - no, it's not a chart-graph question :):):) via the back door.
Within this database, sits a query called "qry-yr10-end-of-year-results". This query contains the fields "student_ID", "Name" and "SumofWeighting_applied".
This "sumofWeighting_applied" is nothing other than a calculated numerical value, I won't bore you with the resaons for its name.
The query returns 11 records, as...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |