DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    JeffM Guest

    SELECT statement and time format


    I have a table with:
    time DATE,
    as a data item and have inserted values, example:
    (..., TO_DATE('08:00 AM', 'HH:MI AM'), ...);
    When I select 'time', I receive output:
    TIME
    ---------
    01-FEB-01

    ...instead of having a time value returned. My question is this: How can
    I structure my SELECT statement so that the data returned from my time column
    is formatted as 'HH:MI am' ?


  2. #2
    Kotta Satyamurthy Guest

    Re: SELECT statement and time format


    "JeffM" <urm_the_mad@yahoo.com> wrote:
    >
    >I have a table with:
    >time DATE,
    >as a data item and have inserted values, example:
    >(..., TO_DATE('08:00 AM', 'HH:MI AM'), ...);
    >When I select 'time', I receive output:
    >TIME
    >---------
    >01-FEB-01
    >
    >...instead of having a time value returned. My question is this: How can
    >I structure my SELECT statement so that the data returned from my time column
    > is formatted as 'HH:MI am' ?
    >



  3. #3
    Kotta Satyamurthy Guest

    Re: SELECT statement and time format



    hey Jeff,

    you can do something like this :

    1 select to_CHAR(sysdate,'HH:MM:SS')
    2* FROM DUAL
    SQL> /

    TO_CHAR(
    --------
    05:02:24



    "JeffM" <urm_the_mad@yahoo.com> wrote:
    >
    >I have a table with:
    >time DATE,
    >as a data item and have inserted values, example:
    >(..., TO_DATE('08:00 AM', 'HH:MI AM'), ...);
    >When I select 'time', I receive output:
    >TIME
    >---------
    >01-FEB-01
    >
    >...instead of having a time value returned. My question is this: How can
    >I structure my SELECT statement so that the data returned from my time column
    > is formatted as 'HH:MI am' ?
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links