Hello,
Thank your very much for Reply.
My requirement is slight different.
start date can be the same as any previous stop date or start date.
stop date can't be same as any previous stop date.
for example , I could have a new start date something like
06/14/99 - 06/14/99
so , in the example of invalid dates
1. 06/14/99 - 06/21/99
06/14/99 is valid date .
Invalid date is 06/21/99 because it overlaps the date 06/20/99
2. 06/15/99 - 06/20/90
Both are invalid dates because 06/15/99 overlaps with 06/14/99
and 06/20/99 is same as previous stop date
Thanks
Mark
************
Mark,
Assuming that your new start date and stop date are m.dStart and m.dStop
SELECT * FROM TableWithExistingPairsOfDates AS MyTable WHERE ;
BETWEEN(m.dStart, MyTable.dStart, MyTable.dStop) OR ;
BETWEEN(m.dStop, MyTable.dStart, MyTable.dStop) ;
INTO CURSOR Overlaps
IF _TALLY > 0
= MESSAGEBOX("Got overlapping dates")
ENDIF
>Hello Friends,
>
>I have to apply following validation in my form. I am not sure whether this can
>be accomplished by sql and if yes then how ? Any help is highly appreciated.
>
>I have two fields like following.
>
>dStart dStop
>
>06/14/99 06/20/99
>06/22/99 06/25/99
>
>Now, a new start and stop date can't overlap with others.
>
>06/14/99 - 06/21/99
>06/15/99 - 06/20/99
>for example here are some invalid date ranges for new record.
>
>
>These are not allowed because they are overlapping with previous records.
>
>Thanks in Advance for all your help.
>
>Thanks
>Mark
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement