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");
}