Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Again!! A Sql Problem
Message
De
15/06/1999 09:55:52
 
 
À
14/06/1999 21:28:48
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00229776
Message ID:
00229934
Vues:
17
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
Fil
Voir

Click here to load this message in the networking platform