string datestart = 下拉菜单[年] + 下拉菜单[月] + “01”;<格式:20150101> string dateend = 下拉菜单[年] + 下拉菜单[月] + “31”;select '' from '' where patime >= convert(datetime,datestart,105) and patime<= convert(datetime,dateend,105)
在sqlserver中可以这样写: SELECT uid,pscore FROM table WHERE year(ptime) = '你选择的年' AND month(ptime) = '你选择的月' 这样就可以按照你选择的年和月进行查询了,亲测有效。
string datestart = 下拉菜单[年] + 下拉菜单[月] + “01”;<格式:20150101>
string dateend = 下拉菜单[年] + 下拉菜单[月] + “31”;
select '' from '' where patime >= convert(datetime,datestart,105) and patime<= convert(datetime,dateend,105)