What is oracle's equivalent of datetime. I'm on a 9i database

Posted on 2009-04-15
Last Modified: 2013-12-19
I'm converting a stored procedure from mssql to oracle, and at the end of the sp, I have....

order by convert(datetime, i.CREATED_DATE) desc;

Oracle does not like datetime.

What's the most simple thing I can do?
Question by:silentthread2k
    LVL 142

    Accepted Solution

    you want this (fill in the format you really have in the varchar field)
    order by TO_CHAR(i.CREATED_DATE, 'yyyy-mm-dd') desc;

    Open in new window

    LVL 73

    Assisted Solution

    date and timestamp are the types you would use in oracle.

    if created_date is one of those you don't need to convert it to sort by it.

    if it's a string you need to use

    to_date(create_date,'mm-dd-yyyy hh24:mi:ss')   --change the format to whatever format your string is in

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This article describes some very basic things about SQL Server filegroups.
    APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    This video shows how to recover a database from a user managed backup

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now