sisibest

导航

SQL 拿到一天内的数据

CreateDate>=startDate&& CreateDate<=endDate

 

 if (!string.IsNullOrEmpty(startDate))
            {
                sbWhere.Append(" and DATEDIFF(day,CreateDate,'"+startDate+"')<=0");
            }

            if (!string.IsNullOrEmpty(endDate))
            {
                sbWhere.Append(" and DATEDIFF(day,CreateDate,'"+endDate+"')>=0");
            }

 

 

posted on 2013-01-06 11:39  sisibest  阅读(213)  评论(0编辑  收藏  举报