开发者

mysql date time

how can i correct it WHERE

listweb.expiredate IS NOT NULL  
and ( listweb.expiredate>= CURRENT_DATE() ) and ( listweb.expiredate < DATEADD(Day, 365, CURRENT_DATE() ) )

SELECT
listweb.id,
listwe开发者_JS百科b.name,
listweb.expiredate
FROM
listweb
WHERE
listweb.expiredate IS NOT NULL  
and ( listweb.expiredate>= CURRENT_DATE() ) and ( listweb.expiredate < DATEADD(Day, 365, CURRENT_DATE() ) )
ORDER BY
listweb.expiredate ASC


You want to use BETWEEN

.
.
WHERE listweb.expiredate BETWEEN
CURRENT_DATE() AND DATEADD(Day, 365, CURRENT_DATE()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜