473,406 Members | 2,404 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,406 software developers and data experts.

access sql ignores "-"

1
shalom

I've sent the following sql query:

SELECT CL_NUMBER From MEMBERS where CL_NUMBER>='420-1' and CL_NUMBER<='420-5'

As a result I received: 420-1 4201-1 420-5

It seems that the access qsl I'm using , ignores the "-" character.

What do I do to prevent it?

Thanks

Mati
Dec 26 '06 #1
2 1180
PEB
1,418 Expert 1GB
Hi Mati,

Marry Cristmas!

In fact you are doing string comparison here in your SQL! So using this kind of comparison Access arranges or evaluates >= or <= using the ASC value of the respective character!

I think that isn't usefull to do this kind of comparision here!

If u want to get the specified numbers... The best is to convert the first part in number and the second one in number...

This conversion can be done using those expressions:

for the first part:

FpartNumber: left([My_number],instr(1,[My_number],"-")-1)

for the second part:

SpartNumber: right([My_number],len([My_number])-instr(1,[My_number],"-")+1)

When u have thos numbers u can apply > < and the others arithmetic operators for comparision!

Hope this helps!
Dec 26 '06 #2
NeoPa
32,556 Expert Mod 16PB
PEB is exactly right.
Try changing the quotes for parentheses :
(420-1) and (420-5) rather than '420-1' and '420-5'.
Dec 30 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
5
by: PetitTrot | last post by:
Sorry if this question is "classic" I am interested know status of MS Access. What is future of MS Access? Do you know a site web with chart of development/support for Access? Thanks
2
by: Tina Robichaux | last post by:
I have found info on this problem at MS, but they say this problem does not occur with SQL 2K and MDAC 2.6 SP2, yet I am still experiencing it: I have a SQL user specifically created to SELECT...
27
by: Bruce Dodds | last post by:
I recently started using Access 2003 for the first time. I wanted to pass on some comments about the Help system to Access MVPs who frequent this board. I'm doing this in the hope that some of...
3
by: Dan | last post by:
Hi, I have a problem using an aspx page with a Control on it. I get the following error message Compiler Error Message: CS1595: 'Test.Class2' is defined in multiple places; using definition...
1
by: itmanager | last post by:
I am trying to create a process at a particular set of coordinates (for example 1,1) but the CreateProcess api seemingly ignores the settings in the dwX and dwY properties of the STARTUPINFO...
27
by: agins | last post by:
I have used nearly every version of ACT for more than 15-years. Currently have 5,000 records in one database and the program seems unable to smoothly handle that many. Am starting a new business...
5
by: turnitup | last post by:
I have a security mechanism that checks that session variables are set, and if not, redirects. It seems, however, that CURL just ignores this statement and completely breaches my security. Does...
6
by: Urs Thuermann | last post by:
With offsetof() I can get the offset of a member in a struct. AFAICS, it is portable and clean to use this offset to access that member. I need to do something like this struct foo { struct...
0
by: Lysander | last post by:
Thought I would give something back with a few articles. This article is a bit of code to add error handling. When I have time, I want to write articles on multilingual databases, and Access...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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,...
0
isladogs
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...

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.