执行以下代码时,我收到错误“'12'运算符后缺少操作数”。
employee.Select(Table.Key + " = '" + dept.Key.ToString() + "' AND " + Table.EnteredDate + "BETWEEN" + startDate + "AND" + endDate)))
答案 0 :(得分:0)
employee.Select(Table.Key + " = '" + dept.Key.ToString() + "' AND '" + Table.EnteredDate.ToString("yyyyMMdd") + "' BETWEEN '" + startDate.ToString("yyyyMMdd") + "' AND '" + endDate.ToString("yyyyMMdd") + "'")))
希望它有效。你的意见不足。
答案 1 :(得分:0)
以下代码有效!
employee.Select(Table.Key + " = '" + dept.Key.ToString() + "' AND " + Table.EnteredDate + " >= '" + startDate.ToString("yyyyMMdd") + "' AND " + Table.EnteredDate + " <= '" + endDate.Value.ToString("dd/MM/yyyy");