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

  • Home
  • SEARCH
  • 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 6920689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:10:48+00:00 2026-05-27T10:10:48+00:00

In a database I’m working with, I have a field in a table that

  • 0

In a database I’m working with, I have a field in a table that has a data type of varchar(10). The field can be null and does not have to contain integers, but most of the time it does. I’m comparing the value of this field in my WHERE clause for every iteration in my query to an integer value. At least one number must exist to the right of the decimal place, and there can be up to 2 decimal places, but most of the time there will be 1. 0.00 could qualify if comparing to 0, but 0 would not qualify because it doesn’t have a decimal after it. What is the safest formula to use so that I’m only considering non-null double values?

Suppose I have these values in my table:

NULL

2.49

2.0

2

2.1

2.4

I’d only like these to consider these values as true in this expression:
2.49
2.0
2.1
2.4

Here’s a start.. I haven’t figured in the NULL nor the decimal situation..

AND CONVERT(INT, fieldname.sortorder)=2

  • 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-05-27T10:10:48+00:00Added an answer on May 27, 2026 at 10:10 am

    Add an additional criteria to do a string comparison.

    AND fieldname.sortorder LIKE '%[0-9].[0-9]%'
    AND CONVERT(INT, fieldname.sortorder)= 2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Database resources, that can be accessed from webpage that I'm currently working on, have
Database has table X and tables An, Bn, Cn, Dn that inherits from X.
The database has a ton of entries that were not escaped because they were
My database table has a column defined to use ON UPDATE CURRENT_TIMESTAMP : Field:
Database has tables Photos and PhotoAlbums. I need a query that will select all
A database application that I'm currently working on, stores all sorts of settings in
database/SQL novice here. I have a table with a column called, for example, EmployeeID.
My database contains records that have: 1) First line delimited with double \n\n and
Database has a table A, and a table B. A.ID is linked with B.ID.
Database is MySQL with MyISAM engine. Table definition: CREATE TABLE IF NOT EXISTS matches

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.