I need a query for this.

In a table, I have two date columns like fromdate and todate. My date format will be yyyy-mm-dd.
I need to know how to compare dates including the given date to take all dates between the given dates
For example,fromdate is 215-08-01 and todate is 2015-08-31
I wrote my query like,
SELECT * FROM tbl_name WHERE fromdate >='215-08-01' AND todate <='2015-08-31'

Is it correct? or Where it is wrong?

Your query appears correct. If you are not getting what you need prepare a sqlfiddle for us to work with, and tell us what output you expect.

Be a part of the DaniWeb community

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