你用的什么数据库,我用的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'
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'
select * from Table1
where datediff(day,convert(datetime,'1950-1-1'),CSNY)>0
and datediff(day,convert(datetime,'1980-1-1'),CSNY)<0
假定你的“出生年月”字段是'CSNY'