如何比较(等于和小于)今天的日期到MYSQL中的给定日期?使用<=
时出现问题。当我使用=
时,这不起作用。我希望两者都小于和平等。
<%
rs=st.executeQuery("select approcode,approemail,appromon,approvemon,approtue,approvetue,approwed,approvewed,approthr,approvethr,approfri,approvefri,approsat,approvesat,commen,months,SUM(nol) from `pushkalit`.`approval`WHERE (CONVERT( `approcode` USING utf8 ) LIKE '%"+user+"%')
AND DATE( NOW( ) ) <= DATE( appromon ) OR
DATE( NOW( ) ) <= DATE( approtue ) OR
DATE( NOW( ) ) <= DATE( approwed ) OR
DATE( NOW( ) ) <= DATE( approthr ) OR
DATE( NOW( ) ) <= DATE( approfri ) OR
DATE( NOW( ) ) <= DATE( approvesat )");
%>
答案 0 :(得分:0)
错误的方向,你现在正在做的比今天更加平等。它应该是NOW( ) >= DATE(....
答案 1 :(得分:0)