Hi...
I have a webpage(ASP.NET2.0+C#) in which i have 2 textboxes and button. The user can enter startdate and time in one textbox and in the other end date and time. The user can click the button to save the changes to the database.
If the user enters the date in the same range as the older one, i want provide a message.
For example:
First time user saves the folowing data: startdate: 06/10/2007 16:32:58 enddate: 08/10/2007 16:32:55
If the second time user enters: startdate: 06/10/2007 16:28:00 enddate: 08/10/2007 20:40:00
In this case, the time entered as startdate in the textbox is overlapped and I need to provide a message to user.
How to do this? Please help
Thanks
It's all about comparing dates. You could do it directly in the SQL query or using C# code. More exactly you need to make sure that the start date of the new date is smaller than the start date of the older one or greater than the end date of the current one. If the new start date is smaller than the old start date, you will also want to check if the new end date is smaller than the old start date.
It's about logic really and making sure that you covered all possible scenarios :)