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

Recommended Answers

All 3 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.