We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,672 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Help me

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

3
Contributors
3
Replies
1 Hour
Discussion Span
2 Months Ago
Last Updated
8
Views
engrmshahzad
Newbie Poster
3 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

not working

engrmshahzad
Newbie Poster
3 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

pritaeas
Posting Prodigy
Moderator
9,265 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86

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

JorgeM
Senior Poster
3,998 posts since Dec 2011
Reputation Points: 294
Solved Threads: 543
Skill Endorsements: 115

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0782 seconds using 2.66MB