Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8802167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:01:20+00:00 2026-06-14T01:01:20+00:00

I am using ColdFusion 8 and SQL Server 2008 R2. I am trying to

  • 0

I am using ColdFusion 8 and SQL Server 2008 R2.

I am trying to query a column of values to get rows with a value within a range. The column SHOULD be numeric, but it’s not. It’s setup as a varchar (by someone else). There are 100,000+ rows of data. Here’s a FAKE sample of the data:

ID COLUMN
1  1
2  1.2 
3  0.9 
4  5 
5  -6

My query looks like this:

select column
from table
where column between 1 and 2

This query won’t run because the where statement’s column is a varchar, and I get a conversion error, so I have to change the where statement to this:

where column between '1' and '2'

Now, when I run a query like this, it runs, but I don’t get results. But I know that I should be seeing results, because I know that many of the values in the column field are within that range I am querying.

I am wondering if I am seeing no results due to the field being a varchar and not a numeric. Might that be messing up my results?

Also, we have 100,000+ records we are searching through, would there be a big performance hit by using a varchar field instead of a numeric field?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:01:22+00:00Added an answer on June 14, 2026 at 1:01 am

    You need to CAST the results WHERE ISNUMERIC(column) = 1 AND CAST(column AS decimal(10,5)) BETWEEN 1 AND 2 for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using SQL Server 2008 and ColdFusion 9.1.2. I have a query that
Using SQL Server 2008... I'm having some troubles in trying to order my rows
I am using Coldfusion 9 and SQL Server 2008. I'm trying to learn the
I am using ColdFusion 9.0.1 and SQL Server 2005. The column in my database
I'm using ColdFusion with Microsoft SQL Server 2005 and on occasion I get this
I am using Coldfusion 8 which is connecting to SQL Server 2008, the problem
I am using SQL Server 2008 Enterprise. I want to add an identity column
I am using SQL Server 2008 Enterprise. I met with issue which says line
I am using SQL Server 2008 Enterprise for development. I find from SQL Server
I am using SQL Server 2008 Enterprise. I am learning OUTPUT parameter of SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.