Start New Discussion within our Web Development Community

SELECT * FROM users WHERE birth_date between '%-02-02' AND '%-05-06'

Assuming MySQL, see the docs here. BETWEEN requires a minimum and maximum value, and does not support a wildcard like LIKE does.

Same goes for MSSQL. If you include the character string '%', MSSQL will generate an error.

This article has been dead for over six months. Start a new discussion instead.