日期:2014-05-18  浏览次数:20662 次

【请教】对数据库进行条件查询
查询条件为:2010-3或者2010年3月这种形式,而数据库里的时间为2010-3-4 23:34这种形式,应该怎么写查询语句?
数据库为sql,谢谢

------解决方案--------------------
where date like '2010-3%'
------解决方案--------------------
select * from users where year(createdate)=2010 and month(createdate)=3
------解决方案--------------------
string[] s=radiobutton.text.split('-');

" ...where date like '"+s[0]+"-"+s[1]+"'";

新手,如果写的不对,见谅。