SQL Query


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: SQL Query

  1. #1
    Sandeep Guest

    SQL Query


    Hello All

    I have one problem in SQL Query.
    I want to compare two dates having timestamps.

    e.g.
    Select SYSDATE From Dual
    Where TO_CHAR(SYSDATE, 'MM/DD/YY hh24:mi:ss') > TO_CHAR('4/18/02 04:04:55',
    'MM/DD/YY hh24:mi:ss')

    I have Oracle8.
    It gives error.

    Can anyone help me in this matter.

    Thanx,
    Sandeep

    Share on Google+

  2. #2
    Larry Miller Guest

    Re: SQL Query

    Why not use TO_DATE(). Ex.
    Select SYSDATE From Dual
    Where SYSDATE > TO_DATE('4/18/02 04:04:55','MM/DD/YY hh24:mi:ss')

    HTH.

    --
    Larry Miller
    MCSD, Microsoft MVP Visual FoxPro
    Bifrost Solutions

    "Sandeep" <Sandeep_S_Kulkarni@ril.com> wrote in message
    news:3cbfb651$1@10.1.10.29...
    >
    > Hello All
    >
    > I have one problem in SQL Query.
    > I want to compare two dates having timestamps.
    >
    > e.g.
    > Select SYSDATE From Dual
    > Where TO_CHAR(SYSDATE, 'MM/DD/YY hh24:mi:ss') > TO_CHAR('4/18/02

    04:04:55',
    > 'MM/DD/YY hh24:mi:ss')
    >
    > I have Oracle8.
    > It gives error.
    >
    > Can anyone help me in this matter.
    >
    > Thanx,
    > Sandeep
    >



    Share on Google+

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