How to fix ERROR[HY000][Oracle][ODBC][Ora]ORA-01858: a non-numeric character was found where a numeric was expected

user 126 Reputation points
2023-04-05T13:42:29.59+00:00

hi here is my request

select * from users a WHERE trunc(A.registered) between to_date(?,'dd/mm/yyyy') and to_date(?,'dd/mm/yyyy') ORDER BY a.name

i use an oracle db (odbc driver) with SSRS when i execute my request i get the error ERROR[HY000][Oracle][ODBC][Ora]ORA-01858: a non-numeric character was found where a numeric was expected can you help me?

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,010 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Olaf Helper 46,281 Reputation points
    2023-04-05T13:57:46.0433333+00:00

    The error is raised by Oracle, not by SSRS, so you may better ask in an Oracle forum. What for parameter values do you pass?


  2. AniyaTang-MSFT 12,451 Reputation points Microsoft External Staff
    2023-04-06T02:24:24.5366667+00:00

    Hi @user I found this link for you about this error: https://stackoverflow.com/questions/29852389/getting-error-ora-01858-a-non-numeric-character-was-found-where-a-numeric-was. According to your comment, do you want to change the format of the SSRS date parameter? The format of SSRS date parameters is generally a date format in the language specified in the browser. If you want to change it, you can refer to this link: https://stackoverflow.com/questions/29775170/i-want-datetime-parameter-in-ddmmyyyy-format-in-ssrs-report. Best regards, Aniya


  3. user 126 Reputation points
    2023-04-06T08:35:10.39+00:00

    I solved the problem by changing the parameter values in the dataset properties like this: for each parameter, dataset settings > parameters > parameter value > I added =Format(CDate(Parameters!param1.Value), "yyyy-MM-dd") to make the format match the date type in the oracle table


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.