关于c#日期查询问题
string time1 = rkrq1.Value.ToShortDateString();string time2 = rkrq2.Value.ToShortDateString();
if (time1.Trim() != "")
{
cond = cond + "and 日期>=" + time1;
}
if (time2.Trim() != "")
{
cond = cond + "and 日期>=" + time2;
}
if (cond != "")
{
sql = "select * from rkb where 1=1 " + cond;
}
else
{
sql = "select * from rkb";
}