473,413 Members | 1,802 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,413 software developers and data experts.

select statement help - newbie

cassbiz
202 100+
I am trying to get the range between 1 and 11 (ie 1,2,3,4,5,6,7,8,9,10,11)

the select statement is:

Expand|Select|Wrap|Line Numbers
  1. select * from zimmer WHERE (Zimmer BETWEEN 1 AND 11)
my output is 1,10,11,100 and 101

I will have to repeat this process with different ranges 12 to 25, 26 to 31, etc...

Any help is appreciated.
Nov 14 '06 #1
2 1084
cassbiz
202 100+
I found the problem, it is that the field is a varchar field. How do I still continue to search it to produce the results or how do I change the column type from varchar to int?

I am trying to get the range between 1 and 11 (ie 1,2,3,4,5,6,7,8,9,10,11)

the select statement is:

Expand|Select|Wrap|Line Numbers
  1. select * from zimmer WHERE (Zimmer BETWEEN 1 AND 11)
my output is 1,10,11,100 and 101

I will have to repeat this process with different ranges 12 to 25, 26 to 31, etc...

Any help is appreciated.
Nov 14 '06 #2
ronverdonk
4,258 Expert 4TB
You can cast the Zimmer field (The CAST() and CONVERT() functions take a value of one type and produce a value of another type).

See MySQL manual Casting functions

Ronald :cool:
Nov 14 '06 #3

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

Similar topics

7
by: Neil | last post by:
Hello, I do hope some kind soul can help me with what I thought was not going to be difficult, but for this newbie it's a bit harder than I thought. Here's what I'm trying to do..... I can...
21
by: John Fabiani | last post by:
Hi, I'm a newbie and I'm attempting to learn howto create a select statement. When I use >>> string1='18 Tadlock Place' >>> cursor.execute("SELECT * FROM mytest where address = %s",string1) All...
17
by: Newbie | last post by:
Dear friends, I am having a hard time understanding how to use a SELECT CASE in ASP. I have used it in VB but never in ASP scripting. Scenerio: I have 2 textboxes on a form that I have to...
7
by: php newbie | last post by:
I am trying to copy data from one table to another, and in the process add a sequence number to copied rows. I have looked at the IDENTITY function when creating tables, and essentially this is...
2
by: Gadrin77 | last post by:
as a newbie to XSL, is it possible to mimic a SELECT/CASE statement using XSL? I tried a quickie and I kept getting errors either using PARAM or WITH-PARAM in the wrong place or VARIABLE. I...
3
by: larry | last post by:
Hi, I am a newbie to Internet programming. I have some questions about spacing in HTML control names and subsequently being able to access these input elements in JavaScript If you don't have...
6
by: Eric Robinson | last post by:
Hi all, I'm having real trouble wrapping my newbie brain around this problem. Can someone please tell me the most efficient (or any!) way to write a SELECT statement to return a set of rows from...
5
cassbiz
by: cassbiz | last post by:
I am having a problem getting a simple form to work. I keep getting an error in the select statement. Error performing query: Unknown column '$zip' in 'where clause' below is my code and it is...
5
by: Chris Cowles | last post by:
I use an application that uses Oracle 8.1.7. All functions of the application are completed with calls to stored procedures. A data entry error occurred that caused thousands of records to be...
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
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...
0
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...

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.