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 9037191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:11:19+00:00 2026-06-16T09:11:19+00:00

Running into the following error in MySQL. I have tried using convert as well

  • 0

Running into the following error in MySQL. I have tried using convert as well with no luck. The customer would like to be able to filter data where a customer ID will be something like: BOB102, REB293, REC203. I will need to pretty much be searching for customer numbers > 200, and so on.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘INTEGER)) > 0 )’ at line 6

SELECT `orders_jobs`.* 
FROM (`orders_jobs`) 
INNER JOIN `orders_users` ON `orders_jobs`.`customer` = `orders_users`.`id` 
WHERE `orders_jobs`.`active` = 1 
AND `orders_users`.`active` = 1 
AND ( CAST(orders_users.cust_number AS INTEGER)) > 0 )

Now these may not always be 3 string characters long it might be 4 also, ie: BKER2938

NOTE: As Edga mentioned, I needed to use UNSIGNED instead of integer, but because of the characters it is converting all to 0 instead, is there possibly a different method?

Data Examples (for the field cust_number):
MTQ32499,BGM31620,RES42935,CAM31717,CRED31672
(note the last one is 4 chars. I believe it will only be 3 or 4 characters long)

I need to return only the customers who have cust_number > 40000

  • 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-16T09:11:21+00:00Added an answer on June 16, 2026 at 9:11 am

    You should use

    CAST AS SIGNED
    

    or

    CAST AS UNSIGNED
    

    More information here

    — edit

    As a workaround you can use SUBSTRING if 5 last characters are always numeric

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

Sidebar

Related Questions

I am running into the following error using Pear Mail: Notice: Error in sending
I currently have the following MySQL query, which I would like to include in
Deployed application to production and running into the following error on views that contain
EDIT: I am basically running into the following documented issue . I am using
I have been attempting to learn Grails, however I am running into the following
I'm using the C# .NET Mysql Connector, and when running this query: INSERT INTO
Using DBD::mysql with DBI, I am getting the following error when attempting to connect
I am currently running the following SQL statement on my MySQL database: INSERT INTO
I'm running XAMPP on win7 to test fairly simple sites using PHP/MySQL/AJAX, and have
I keep running into an error from the following statement: cursor.execute(INSERT into financial_statements (url)

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.