SQL 语句:    'select * from table where “出生年月”字段>=1950-1-1 and “出生年月”字段<=1980-1-1'

解决方案 »

  1.   

    你用的什么数据库,我用的Sybase,Sql语句可以这么写:
    select * from Table1 
    where datediff(day,convert(datetime,'1950-1-1'),CSNY)>0
      and datediff(day,convert(datetime,'1980-1-1'),CSNY)<0
    假定你的“出生年月”字段是'CSNY'      
      

  2.   

    Access:Select * From Table1 Where BirthdayDate>=DateValue('1950-1-1') and BirthdayDate<=DateValue('1980-1-1') SQLServer:Select * From Table1 Where BirthdayDate>='1950-1-1' and BirthdayDate<='1980-1-1'