日期:2014-05-17 浏览次数:21146 次
DateTime dt1 = DateTime.Parse("2013-6-1");
DateTime dt2 = DateTime.Parse("2013-6-22");
for (; dt1.CompareTo(dt2) > 0; dt1.AddDays(1))
{
string sql = "select * from test where dt1=" + dt1 + "";
DataTable dtTemp = new DataTable(); //执行sql,返回dtTemp
if (dtTemp.Rows.Count <= 0)
{
string sqlTemp = "select * from test where dt1=" + dt1.AddDays(-1) + "";
//没有记录,则取昨天的填充
}
}