Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select records that fall 3 consecutive days within a wee
Message
De
21/12/2003 23:49:39
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
21/12/2003 23:03:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00861173
Message ID:
00861181
Vues:
22
I doubt you can do this with a single, or a few, SQL - SELECT statements. I would go ahead and program the loop. For instance, loop through the records, maintain a variable that holds the date for the previous record, increase a counter variable for the number of consecutive days, and if you got 3 or more, go back and transfer the three records to another table, or cursor.

Some more details need to be worked out, of course.

>i have table dtr with fields empno, swipedate and ti1 (logical). i want to select all ti1 = .t. for every employee that falls in 3 consecutive days within a week.
>
>say,
>
>0001 12/01/2003 F
>0001 12/02/2003 T
>0001 12/03/2003 T
>0001 12/04/2003 T
>0001 12/05/2003 F
>
>0001 12/06/2003 F
>0001 12/07/2003 F
>
>0001 12/08/2003 T
>0001 12/09/2003 T
>0001 12/10/2003 F
>0001 12/11/2003 T
>0001 12/12/2003 T
>.
>.
>.
>0001 12/31/2003 F
>
>i should be able to select empno 0001 and dates 12/02/2003, 12/03/2003 and 12/04/2003. i should be able to do this per employee. table dtr contains a thousand of different empno.
>
>please advise me..
>
>TIA
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform