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
Suivant
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