string cmdText = "select attentiontime, nickname, message from message,person where attentiontime>=" + DateTime.Now + " and attentiontime=<" + DateTime.Now.AddDays(1) + " and message.personid=person.id";语法错误:
where attentiontime>=" + DateTime.Now + " and attentiontime=<" + DateTime.Now.AddDays(1) + " and message.personid=person.id";
where attentiontime>=" + DateTime.Now + " and attentiontime=<" + DateTime.Now.AddDays(1) + " and message.personid=person.id";
where attentiontime>='" + DateTime.Now.ToString() + "' and attentiontime<='" + DateTime.Now.AddDays(1).ToString() + "' and message.personid=person.id";
试一试
改成=>DateTime.Now.ToString(strFormat)
试试看
有这样的写法??!?!
呵呵,给你看出来了,就是>= 写成了=>,这个出错了!谢谢各位