Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Again!! A Sql Problem
Message
From
14/06/1999 21:28:48
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
14/06/1999 18:59:01
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00229776
Message ID:
00229812
Views:
21
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform