I have this code for mysql, and in my table i have date entries in my date field from my date table ....i want to make use with between clause ...below is my sql statement..but it displays nothing even there are dates in between...


SELECT * FROM date WHERE date BETWEEN 2011-01-01 AND 2011-12-31


Whats wrong with this code?

thanks...

Recommended Answers

Try with quote.

SELECT * FROM `date` WHERE date BETWEEN '2011-01-01' AND '2011-12-31'
Jump to Post

All 2 Replies

Try with quote.

SELECT * FROM `date` WHERE date BETWEEN '2011-01-01' AND '2011-12-31'

its running thanks...problem solved..

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.