Check Whether A Date Lies Between Two Dates Using SQL
Posted on 2010-08-16
I have a given date, lets call it MyDate. I wish to check whether this date lies between two dates in a table using SQL like This:
"Select * From TableName Where MyDate Between CrStart And CrEnd".
TableName represents a Table of Bookings For A Conference Room. CrStart and CREnd Represent existing Bookings for a Specific conference room. If Mydate lies between CrStart and CREnd then the request should be rejected as "Conference Room Not Available".
I hope I am making myself clear. SQL does not like the Select Statement as it is.
Can somebody help me with this please.