开发者

mysql date time

开发者 https://www.devze.com 2023-02-05 19:16 出处:网络
how can i correct it WHERE listweb.expiredate IS NOT NULL and ( listweb.expiredate>= CURRENT_DATE() ) and ( listweb.expiredate < DATEADD(Day, 365, CURRENT_DATE() ) )

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

精彩评论

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