Hi all
Ok i have no idea where to start so here it goes:
I have a table for Leave Applications where i store the First_Day of application and the duration in form of two fields days and hours.
Now when a user adds a new record i have to check if the new date and its duration will overlap with any other record!
Eg: if i insert First_day = '15/04/2004' with a duration of 4 days thus making an end date of '19/04/2004' will crash if :
1) i have a record with a First_day '17/04/2004'
2) i have a record with First_day '14/04/2004' having a duration of 2 days
3) have a record with first_day '13/04/2004' and duration of 1 day and 2 hrs where a day is 8 hrs !
From this logic i need to create an SQL ??!! any help pls! even pointer will be helpful!
Hope i made myself clear!
Thanks
Nick
Ok i have no idea where to start so here it goes:
I have a table for Leave Applications where i store the First_Day of application and the duration in form of two fields days and hours.
Now when a user adds a new record i have to check if the new date and its duration will overlap with any other record!
Eg: if i insert First_day = '15/04/2004' with a duration of 4 days thus making an end date of '19/04/2004' will crash if :
1) i have a record with a First_day '17/04/2004'
2) i have a record with First_day '14/04/2004' having a duration of 2 days
3) have a record with first_day '13/04/2004' and duration of 1 day and 2 hrs where a day is 8 hrs !
From this logic i need to create an SQL ??!! any help pls! even pointer will be helpful!
Hope i made myself clear!
Thanks
Nick