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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:19:12+00:00 2026-05-23T00:19:12+00:00

I am using SQL query to pull some student records from SQL database. I

  • 0

I am using SQL query to pull some student records from SQL database. I am getting the error Arithmetic overflow error converting expression to data type datetime. It looks like there is a column for student number which is char(15) type and throwing this error every time I put a letter in front of the student number (we have students with this case).

This works fine

Select * from StudentDataTable where StudentNumber = '123456789'

This throws the error

Select * from StudentDataTable where StudentNumber = 'A12345678'

Any help would be appreciated.

  • 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-23T00:19:14+00:00Added an answer on May 23, 2026 at 12:19 am

    SQL is converting the student number to an integer in the background, so your first examples works, but your second one won’t. Check what data-type student number is, it should be numeric type, INT, BIGINT etc..

    Also, you should be querying without the quotes for the student number, saves SQL converting

    Select * from StudentDataTable where StudentNumber = 123456789
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using SQL Query Analyzer to build a report from the database on one
I have a Pl/SQL query that pull all records from the 3 tables. That
Can LINQ to SQL query using NOT IN ? e.g., SELECT au_lname, state FROM
I'm running an SQL query against a mainframe DB2 database using the OdbcDataReader class
I am attempting to pull some information from my tnsnames file using regex. I
I am using sql server as my database engine. I need a sql query,
I'm using this sql query: select sysdate, sysdate - INTERVAL '6' month from dual;
I'm using a SQL query that is similar to the following form: SELECT col1,
I've got a sql query (using MS-SQL 2005) that generates data with these columns:
I've got a sql query (using Firebird as the RDBMS) in which I need

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.