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()
精彩评论