标签:
if (Request.QueryString["start"] == null)
{
for (int i = 0; i < 6; i++)
{
if (DateTime.Today.AddDays(-i).DayOfWeek.ToString() == "Friday")
{
strWhere += " and left(convert(varchar,AddTime,21),10)= ‘" + DateTime.Today.AddDays(-i).ToString("yyyy-MM-dd") + "‘";
this.txtStartTime.Value = DateTime.Today.AddDays(-i).ToString("yyyy-MM-dd");
}
}
}
拼sql条件时判断 是不是当前时间是不是周五,如果今天不是周五,就选上周五
标签:
原文地址:http://www.cnblogs.com/ChengBaoke/p/4674102.html