select *
from tablename
where datediff(day,getdat(),m_birthday)=0

解决方案 »

  1.   

    夜大哥的好像...select * from tablename
    where month(m_birthday)=month(getdate()) and day(m_birthday)=day(m_birthday)
      

  2.   

    m_birthday字段的格式是什么样子的?
      

  3.   

    上面的
    where month(m_birthday)=month(getdate()) and day(m_birthday)=day(m_birthday)好象是
    where month(m_birthday)=month(getdate()) and day(m_birthday)=day(getdate())
      

  4.   

    select * from 表
    where
        datediff(dd,dateadd(yy,datediff(yy,生日字段,{fn now()}),生日字段),{fn now()})=0
      

  5.   

    select * from 表
    where
        datediff(dd,dateadd(yy,datediff(yy,生日字段,{fn now()}),生日字段),{fn now()})=0
      

  6.   

    上面的
    where month(m_birthday)=month(getdate()) and day(m_birthday)=day(m_birthday)好象是
    where month(m_birthday)=month(getdate()) and day(m_birthday)=day(getdate())
    ----------------------
    *_* 
     果然....3Q
      

  7.   

    select * from tablename
         where datediff(day,getdat(),m_birthday)=0用神的办法就可以
    where month(m_birthday)=month(getdate()) and day(m_birthday)=day(getdate())
    这咱方法有点太...
    ^^
      

  8.   

    select * from table
    where datediff(day, getdate(), replace(convert(varchar(10), m_birthday, 121), cast(year(m_birthday) as varchar), cast(year(getdate()), varchar)) = 0
      

  9.   

    select * from table
    where datediff(day, getdate(), replace(convert(varchar(10), m_birthday, 121), cast(year(m_birthday) as varchar), cast(year(getdate()) as varchar)) = 0
      

  10.   

    select * from table
    where datediff(day, getdate(), 
    replace(convert(varchar(10), m_birthday, 121), 
    cast(year(m_birthday) as varchar), 
    cast(year(getdate()), varchar))) = 0
      

  11.   

    我CALL,这么麻烦吗?我一直用
    "select * from table where m_birthday='"&now()&"'"
      

  12.   

    "select * from table where m_birthday='"&date()&"'"
      

  13.   

    楼主,你用得now() 是其他语言中的函数
    在SQL中的当前日期函数应该是 getdate()
      

  14.   

    sxycgxj(云中客) ( ) 信誉:100 
    select * from tablename
         where datediff(day,getdat(),m_birthday)=0用神的办法就可以
    where month(m_birthday)=month(getdate()) and day(m_birthday)=day(getdate())
    这咱方法有点太...
    ^^
    -------------------------------------------
    where datediff(day,getdat(),m_birthday)=0這個不是找生日的吧 @_@
    生日不考慮年,只考慮月和日的吧~~~
      

  15.   

    上面写 where m_birthday='"&date()&"'" 或 '"&now()&"'"
    或where datediff(day,getdat(),m_birthday)=0 的朋友,你们一辈子只过一次生日么?