1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Rep Power
    I have a timestamp field in a customers table, which is set to the current date/time when a new customer is registered. I want to run daily reports listing all customers who registered that day, but I can't simply query the db (MySQL) where timestamp = '2000-0-521'. Do I need to check for "where timestamp >= '2000-05-21 00:00:00' and timestamp <= '2000-05-21 23:59:59"? If so, how do I convert a date to a datetime type?

    any help is appreciated. thanks.
    -- tine
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Niagara Falls (On the wrong side of the gorge)
    Rep Power
    if the date column is called register_date:

    select * from customers where to_days(register_date)=to_days(now());

    assuming you are running this the same day. If the next day you'll have to change the second part of the conditional to: =(to_days(now())-1)

Similar Threads

  1. innerhtml comparison and limitations?
    By bryanandrews in forum HTML Programming
    Replies: 0
    Last Post: December 16th, 2003, 06:43 AM
  2. Warning: comparison bet pointer & integer
    By lpardue in forum C Programming
    Replies: 3
    Last Post: December 4th, 2003, 02:01 PM
  3. variable comparison
    By oli in forum Perl Programming
    Replies: 6
    Last Post: August 27th, 2003, 05:29 PM
  4. count () comparison to DB???
    By cstephenson in forum PHP Development
    Replies: 1
    Last Post: November 4th, 2002, 11:00 AM
  5. XSLT problem: numeric comparison
    By sunnychan in forum XML Programming
    Replies: 1
    Last Post: August 11th, 2002, 07:08 PM

IMN logo majestic logo threadwatch logo seochat tools logo