SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    datetime datatype issue

    hi

    i have the scheduled_date column(datetime datatype) in message table.

    i have the record having scheduled_date 2010-03-26 11:15:00.

    but when i execute this query , empty result set is coming..........

    select * from messages where schedule_date>='2010-03-26 11:14:34' and schedule_date<='2010-03-26 11:15:34' AND status='3' order by created_date

    please help me urgent................

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The problem is elsewhere (status?), as that query would match that row based on the date.

    Code:
    mysql> create table messages (schedule_date datetime);
    Query OK, 0 rows affected (0.05 sec)
    
    mysql> insert into messages (schedule_date) values ('2010-03-26 11:15:00');
    Query OK, 1 row affected (0.00 sec)
    
    mysql> select * from messages where schedule_date>='2010-03-26 11:14:34' and schedule_date<='2010-03-26 11:15:34';
    +---------------------+
    | schedule_date       |
    +---------------------+
    | 2010-03-26 11:15:00 |
    +---------------------+
    1 row in set (0.00 sec)

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi

    yes you are right,

    i have tested removing status after posting the thread

    thank u very much for immediate help


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
  •