select * from 表 where userBirth between '2004-10-01' and '2004-10-30'

解决方案 »

  1.   

    select * from 表 where datediff(month,userbirth,'2004-10-1')=0
      

  2.   

    招聘软件开发工程师:
    1、计算机及相关专业本科以上学历;具有两年以上软件开发经验。
    2、精通VB、VC等开发工具,熟悉SQL SERVER等大型数据库。
    3、能读懂流程图及相应详细设计框图。
    4、创新意识强,具有团队合作精神。
    联系人:李先生  0898-68582235  [email protected]
      

  3.   

    To AntingZ:
        我测试了一下,不可行,只能选出2004年出生的User。
      

  4.   

    select * from 表 where month(UserBirth)=10
      

  5.   

    10月份还有31号,要不要,
    b不包括31号的话:select * from 表 where month(UserBirth)=10 and day(UserBirth)<>31
      

  6.   

    如果他刚好是2004-10-1出生的,那么算不算过生日,如果不算:select * from 表 where month(UserBirth)=10  and year(UserBirth)<2004
      

  7.   

    select * from 表 where UserBirth>时间1 and UserBirth<时间2
      

  8.   

    NETDemon你误解了。根据AntingZ的写法,我写了一个,大家看行不行?
    select * from users where month(dateBirth)=10 and day(dateBirth) between '01' and '30' and year(dateBirth)<2004