Hello,
I have 2 dates i.e: Arrival Date and Departure date from user.
Now i have dates in database like same as above. I want to make sure that there's no clash between the dates entered by customer with the dates in database.
For example: If my arrival date is: 10-1-2005 and departure date is: 17-1-2005 and date in db's are:
- 3-1-2005 to 10-1-2005
- 11-1-2005 to 18-1-2005
- 9-1-2005 to 15-1-2005
- 10-1-2005 to 17-1-2005
So if it compares with date 1 then it should say available but it should say not available when compared with date 2 and 3 and 4.
So there should be no clash of dates at all with the range..provided by user with the dates in db. If there is a clash then say "not available" and if there is no clash then say: "available".
Can someone help me with this ? As i am trying to figure it out for days now and i have reached no where.
Or maybe just tell me the logic on how to check or compare dates for clashes then i will do it.
Any help will be highly appericiated.
Thanks.