不知道你的time字段是什么格式,如果是取UNIX时间戳记的话,
sql语句可以这么考虑
select * from yourtables where time<$test$test取今天0时0分的时间戳记
如2004-6-9 00:00:00时间戳记=1086710400如果time中字段为2004-6-9的格式,可用strtotime()函数化
用时间戳记的形式,
个人觉得,用时间戳记的话,在计算移动时间等问题上比较方便,呵

解决方案 »

  1.   

    select * from tbl where TO_DAYS(time) = TO_DAYS(NOW())
      

  2.   

    select * from Table where id>0 and datediff(day, datetime, Getdate())=0
      

  3.   

    d同意楼上 ice_berg16(寻梦的稻草人)
      

  4.   

    如果在数据库中存入是unix时间,就是以数值型的话也可以用下面的:select * from table where time>=strtotime("Y-m-d",time()) and tim<=strtotime("Y-m-d",time())+24*3600-1