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...

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