你自己写的sql语句就能完成任务啊,只是需要把参数传入就可以了string sqlQueryTime =String.Format( "select*from WorkDiary where (Time >='FirstDay'and Time<= 'LastDay')and( Name='{0}')",name);