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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:44:12+00:00 2026-05-20T10:44:12+00:00

I have a somewhat complex SQL query that is pulling from a table of

  • 0

I have a somewhat complex SQL query that is pulling from a table of invoices. The table being queried uses three number fields to create a date (one for day, month, and year).

This query uses a combination of concat function calls inside of a TO_DATE function. In the SELECT part of the query there is no problem, but when I use an identical statement in the WHERE clause, I get a “ORA-01858: a non-numeric character was found where a numeric was expected” that refers to the first use of concat inside of TO_DATE in the WHERE clause.

So, what is different about using concat and TO_DATE in a where clause?

For example, this following part of the WHERE causes the non-numeric character error

to_date(
  concat(invoice_year,
  concat('-',
  concat(invoice_month, 
  concat('-',invoice_day)))),'YYYY-MM-DD')
  > add_months(sysdate,-6)

but this statement in the select evaluates just fine

to_date(
  concat(invoice_year,
  concat('-',
  concat(invoice_month,
  concat('-',invoice_day)))),'YYYY-MM-DD') as invoice_date
  • 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-20T10:44:12+00:00Added an answer on May 20, 2026 at 10:44 am

    There may be rows in the table that will cause an error when the TO_DATE expression is evaluated; but that do not meet the other conditions in the WHERE clause.

    When you put the expression in the SELECT list, it is not evaluated until a row has passed all conditions in the WHERE clause.

    When you use the expression in a condition, it may be evaluated before the other conditions, so it might now be evaluated for rows where it causes the error.

    Note that if you have NULLs in any of those fields for a given row, it would cause the error.

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

Sidebar

Related Questions

I have a somewhat complex query that I want to use as a source
I'm looking to perform a somewhat complex SQL Query and I'm having a bit
I have several somewhat separate programs, that conceptually can fit into a single project.
I have a somewhat complex regular expression which I'm trying to match against a
I have a somewhat complex custom user control, created in C# .NET, which is
I'm working on a fairly complex Android application that requires a somewhat large amount
I have a table that contains partial data that is of no use to
I have somewhat interesting development situation. The client and deployment server are inside a
Does VS2008 have somewhat C++0x standard support? DUPLICATE Visual Studio support for new C
I have a somewhat messily-formatted Objective-C code base. Is there a way to have

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.