where date from to
string startDate = "2021/10/30";
if (startDate.Length > 0)
{ sql += " and CONVERT(DATETIME, convert(varchar, CallDate, 111), 111) >= CONVERT(DATETIME, '" + startDate + "', 111) "; }
string endDate = "2021/11/30";
if (endDate.Length > 0)
{ sql += " and CONVERT(DATETIME, convert(varchar, CallDate, 111), 111) <= CONVERT(DATETIME, '" + endDate + "', 111) "; }
留言
張貼留言