ORA-01830: date format picture ends before converting entire input string / Select sum where date query

后端 未结 6 1583
梦谈多话
梦谈多话 2020-12-04 22:17

I am trying to execute my query through Java like this:

public ResultSet execSumStatment2() throws SQLException{
String query = \"Select SUM(A) as NCCSeptemb         


        
6条回答
  •  离开以前
    2020-12-04 22:36

    You can use

    Select to_date('08/15/2017 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM') from dual;

    If you are using it in an SP then your variable datatype should be Varchar2

    and also in your ado.net code the datatype of your input parameter should be

    OracleDbType.Varchar2

    Basically I had to put a DateFrom and DateTo filter in my SP so I passed dates as String in it.

    Note: This is one of the solution which worked for me, there could be more solutions to this problem.

提交回复
热议问题