Home Forums SQL Server 2008 Working with Oracle Convert date format in SQL sever report(BIDS) with Oracle date format RE: Convert date format in SQL sever report(BIDS) with Oracle date format

  • Seattlemsp (1/25/2012)


    during the passed days, I tried many times. However it still doesn't work for me.

    The error message said: ORA-00900: invalid SQL statement

    It looks like I may not declare the variable or parameter right, or may not put them in the right place.

    Such as can I mix the SQL statement with all other inside the qurey build window or not?

    Hard to tell if you do not show us what you are doing but for sure something is wrong with the syntax, check below:

    SQL>

    SQL> variable startdate varchar2(11)

    SQL> exec :startdate := '01-JAN-2011'

    PL/SQL procedure successfully completed.

    SQL> variable enddate varchar2(11)

    SQL> exec :enddate := '31-DEC-2011'

    PL/SQL procedure successfully completed.

    SQL> select created from v$database where created between to_date(:startdate, 'dd-mon-yyyy') and to_date(:enddate, 'dd-mon-yyyy') ;

    CREATED

    ------------------

    11-AUG-11

    SQL>

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.