SQL 日。年。月。星期
时间:2011-03-24 来源:沐海
switch (selecttime)
{
case -1: where = "1=1";
break;
case 1: where = "Day(CreateTime)=Day(getdate())";
break;
case 2: where = "datepart(week,CreateTime)=datepart(week,getdate())";
break;
case 3: where = "month(CreateTime)=month(getdate())";
break;
case 4: where = "year(CreateTime)=year(getdate())";
break;
default:
break;
}
相关阅读 更多 +