0

HI,
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?

2
Contributors
1
Reply
13
Views
1 Year
Discussion Span
Last Post by pritaeas
1

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.