SELECT statement and time format


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: SELECT statement and time format

  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' ?
    >



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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center