473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Access Comparison Operators

TMALSS: Task With maintenance of Access Database I did not develop,
don't ask about non-commented code problems or where data dictionary
is (LOL).

Have table with Inventory data for all Publications held,
[tblPubInv.InvNbr] contains binder number on shelf and is text data
in numeric/alpha form i.e.; 123, 1234, 123a, 1234c.

I want to stuff the last character of [tblPubInv.InvNbr] into a new
column [tblPubInv.BndNbrExt] if it is alpha. In addition, will later
convert InvNbr to a numeric field.
(As it is creates the last, first name in one column situation).

I thought I knew something about Comparison Operators in access but
am now am not sure (I like to test prior to committing to code and I
prefer "true" over "false" on conditions), the first query I did
returned all the records in the table

Returns all 3867 records
SELECT ALL tblPubInv.PubNbr, tblPubInv.InvNbr
FROM tblPubInv
WHERE ((((Right([tblPubInv]![InvNbr],1)>Chr(64)))=True))
ORDER BY tblPubInv.InvNbr, tblPubInv.PubNbr;

Seems to me that the above should filter out records with ASCII
values of Chr(0) thru Chr(64)

So I rephrased my query and got the 380 records with an alpha
character in last position (what I want)
SELECT ALL tblPubInv.PubNbr, tblPubInv.InvNbr
FROM tblPubInv
WHERE ((((Right([tblPubInv]![InvNbr],1)<Chr(65)))=False))
ORDER BY tblPubInv.InvNbr, tblPubInv.PubNbr;

The above works, filters out records with last position ASCII value
of Chr(0) thru Chr(64)

Returns the 380 records with an alpha character in last position
(what I want)
SELECT ALL tblPubInv.PubNbr, tblPubInv.InvNbr
FROM tblPubInv
WHERE ((((Right([tblPubInv]![InvNbr],1)>=Chr(65)))=True))
ORDER BY tblPubInv.PubNbr, tblPubInv.InvNbr;

The above also works, filters out records with last position ASCII
value of Chr(0) thru Chr(64)

What the heck am I missing on how Access Comparison operators work?
Have a nice day. ld****@NOPANTS.juno.com

Remove NOPANTS. To reply by direct E-Mail;
Support: The Right to Privacy and Anti-SPAM projects
Nov 13 '05 #1
1 5075
Thats Me wrote:
TMALSS: Task With maintenance of Access Database I did not develop,
don't ask about non-commented code problems or where data dictionary
is (LOL).

Have table with Inventory data for all Publications held,
[tblPubInv.InvNbr] contains binder number on shelf and is text data
in numeric/alpha form i.e.; 123, 1234, 123a, 1234c.

I want to stuff the last character of [tblPubInv.InvNbr] into a new
column [tblPubInv.BndNbrExt] if it is alpha. In addition, will later
convert InvNbr to a numeric field.
(As it is creates the last, first name in one column situation).

I thought I knew something about Comparison Operators in access but
am now am not sure (I like to test prior to committing to code and I
prefer "true" over "false" on conditions), the first query I did
returned all the records in the table

Returns all 3867 records
SELECT ALL tblPubInv.PubNbr, tblPubInv.InvNbr
FROM tblPubInv
WHERE ((((Right([tblPubInv]![InvNbr],1)>Chr(64)))=True))
ORDER BY tblPubInv.InvNbr, tblPubInv.PubNbr;

Seems to me that the above should filter out records with ASCII
values of Chr(0) thru Chr(64)

So I rephrased my query and got the 380 records with an alpha
character in last position (what I want)
SELECT ALL tblPubInv.PubNbr, tblPubInv.InvNbr
FROM tblPubInv
WHERE ((((Right([tblPubInv]![InvNbr],1)<Chr(65)))=False))
ORDER BY tblPubInv.InvNbr, tblPubInv.PubNbr;

The above works, filters out records with last position ASCII value
of Chr(0) thru Chr(64)

Returns the 380 records with an alpha character in last position
(what I want)
SELECT ALL tblPubInv.PubNbr, tblPubInv.InvNbr
FROM tblPubInv
WHERE ((((Right([tblPubInv]![InvNbr],1)>=Chr(65)))=True))
ORDER BY tblPubInv.PubNbr, tblPubInv.InvNbr;

The above also works, filters out records with last position ASCII
value of Chr(0) thru Chr(64)

What the heck am I missing on how Access Comparison operators work?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You may wish to use a more SQL compliant criteria:

SELECT PubNbr, InvNbr
FROM tblPubInv
WHERE InvNbr LIKE "*[a-z]"
ORDER BY PubNbr, InvNbr

Using Like "*[a-z]" means select all rows where the column InvNbr value
ends with the any letters between a and z. Since Access is not case
sensitive you can use either [a-z] or [A-Z] and it will recognize any
case letters.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQbOeVYechKqOuFEgEQJNHACZARYBG38JA/2zftSgdPJAyNqJh0cAnjR1
qPOqscni0+174gmLnHB3toKQ
=Sh8o
-----END PGP SIGNATURE-----
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Klatt | last post by:
I've just encountered a strange situation (at least to me) regarding friend operators and member operators: #include <map> class Key { friend bool operator<(const Key& lhs, const Key& rhs)...
19
by: Dan. | last post by:
hi there, a while back i got into a bit of ASP programming and needed database access. since msAccess was installed on the system i was using at the time i used that and have used that since. but...
13
by: jstanforth | last post by:
This is probably a very obvious question, but I'm not clear on what operators need to be implemented for std::map.find() to work. For example, I have a class MyString that wraps std::string, and...
29
by: Steven D'Aprano | last post by:
Playing around with comparisons of functions (don't ask), I discovered an interesting bit of unintuitive behaviour: >>> (lambda y: y) < (lambda y: y) False Do the comparison again and things...
2
by: PengYu.UT | last post by:
I'm wonder whether 1. stl directly defined the 6 comparison operators(== != < > <= >=) directly for iterator and const_iterator 2. or it only define == and < and using std::rel_ops to get the...
2
by: Serve La | last post by:
Now that implementations are becoming available, I've started to learn more about C99. Now I was reading about the isgreater/isgreaterequal/isless/... macro's and I'm wondering about why they are...
37
by: spam.noam | last post by:
Hello, Guido has decided, in python-dev, that in Py3K the id-based order comparisons will be dropped. This means that, for example, "{} < " will raise a TypeError instead of the current...
17
by: Dinsdale | last post by:
I would like to compare a string value to a pre-determined list of other strings. Is there a simple way to do this in one statements like this: if(strMystring.ToUpper() == ("STRING1"| "STRING2"|...
2
by: Mark Rae | last post by:
Hi, This isn't *specifically* an ASP.NET question, so I've also posted it in the ADO.NET group - however, it's not too far off-topic... Imagine a SQL Server 2005 database with a table with an...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.