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


  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
    >




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