Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Location
    Kuala Lumpur, MY
    Posts
    108

    Unanswered: select (on hourly basis)

    hie all,
    i have datas in a table and the reload date is stored this format
    1/8/2006 11:59:34 PM

    the question is
    how do i select the datas which are on that date.. lets say from
    1/8/2006 00:00:00 AM to 1/8/2006 00:00:59 AM

    and maybe for the date 1/8/2006 which comprises data from 00:00:00 AM to 11:59:59 PM (the full day)

    any help here ?

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    You can do this:
    Code:
    select * from mytable
    where datecol between to_date('01/08/2006 00:00:00','MM/DD/YYYY HH24:MI:SS')
    and to_date('01/08/2006 23:59:59','MM/DD/YYYY HH24:MI:SS')
    or this for a full day only:
    Code:
    select * from mytable
    where datecol >= date '2006-08-01'
    and datecol < date '2006-08-02'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •