How to check whether the given date lies between the existing date in the database.

Posted by Santhi under ASP.NET on 5/22/2012 | Points: 10 | Views : 822 | Status : [Member] | Replies : 1
Hi all,

My db structure:

Empcode fromdate todate.
ec01 01-18-2012 01-23-2012
ec01 01-24-2012 03-28-2012


There may be several records for the same employee in the table..
if i select the date from jan 19 to 27th march..
This should not allow me to insert the record.. because already this employee has applied leave from 18 th jan to 23 jan and this has been approved by the approver..
Again he is deciding to take leave from 24th jan to 28th march.. This also has been approved by the approver..

Again he is trying to give 19th jan to 27th march..
This date lies between the dates which is exisiting on the database...

So, i have to restrict by setting the validation..
How can i check whether the given date lies between these dates...


I got if the date lies between the same month..
But i didnt get whether the given date lies between different months..

Thanks in advance.

Thanks & Regards,
Santhi .V



Responses

Posted by: Santhi on: 5/22/2012 [Member] Starter | Points: 25

Up
0
Down
Anybody give me the solution to solve this.

Thanks & Regards,
Santhi .V

Santhi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response