[em10][em10]最近在做一个办公自动化系统,其中需要从数据库中读取某一段时间的记录,怎么比较输入时间与数据库中的时间:比如:

Dim year0 As String = DropDownList1.SelectedItem.Text
Dim year1 As String = year0 + "-" + "1" + "-" + "1"
Dim year2 As String = year0 + "-" + "12" + "-" + "31"

cmd.CommandText = "Select * from zaojing_infor where jing_leixing='" + DropDownList2.SelectedItem.Text + "' and shenpi_time>='" + year1 + "' and  shenpi_time<='" + year2 + "'"


其实也就是sql数据库可否比较字符串或如何比较时间的问题!
请大虾帮帮我