VS2022 and SSRS – Problem with parameter and Oracle database

user 126 Reputation points
2023-02-27T13:38:03.56+00:00

here is my request

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

@Date and @Datee are the parameters I created; i use an oracle db

when i put my request in my dataset and when i refresh the fields i get the error ERROR[HY000][Oracle][ODBC][Ora]ORA-00936: missing expression and my report does not run.

on the other hand when I delete the where clause I receive no error and my report runs normally

the conclusion is that my problem is certainly at the level of the where clause. however at first sight I do not see the error

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,061 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,702 questions
SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,344 questions
{count} votes

Accepted answer
  1. Anonymous
    2023-02-28T05:42:04.1266667+00:00

    Hi @user

    In SSRS with an Oracle OLEDB connection, if you want to use parameters, you need to use a colon, not the @ sign.

    For more details, you can refer to this link: parameter in sql query :SSRS.

    Best regards,

    Aniya

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. user 126 Reputation points
    2023-02-27T14:32:26.3133333+00:00

    I found the solution

    • with oracle you must use the character : concerning the parameters
    • you must not use the parameter name DATE which is protected by oracle
    1 person found this answer helpful.
    0 comments No comments

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.