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

Recommended Answers

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

Jump to Post

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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.