Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I seperate blocks of time in a table?
Message
De
06/01/2005 08:16:19
 
 
À
05/01/2005 16:14:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
00973326
Message ID:
00974655
Vues:
15
I assume it means Integer

Peter

>David,
>
>Thanks! Sorry for the late reply but, this works great! May I ask a question about your coding? I notice that you use "i" as part of your naming? I was wondering what that means? Your "t" I would assume to mean time. I am fairly new to coding, just trying to understand the different naming conventions out there.
>
>
>>Chad,
>>
>>
>>create cursor x1 ( tWhen t, iCount i )
>>insert into x1 values ( {^2004-12-30 12:36:55}, 0 )
>>insert into x1 values ( {^2004-12-30 12:57:24}, 45 )
>>insert into x1 values ( {^2004-12-30 15:43:08}, 389 )
>>insert into x1 values ( {^2004-12-30 19:35:06}, 871 )
>>insert into x1 values ( {^2004-12-30 20:00:00}, 872 )
>>insert into x1 values ( {^2004-12-30 23:26:00}, 1339 )
>>insert into x1 values ( {^2004-12-31 03:19:59}, 1836 )
>>
>>create cursor production ( iElapsedTime i, iIntervalCount i, iSecondsPerPiece i )
>>
>>select x1
>>go top
>>ltLastTime = x1.tWhen
>>liLastCount = x1.iCount
>>skip
>>scan rest
>>   ltElapsedTime = x1.tWhen - ltLastTime
>>   liElapsedCount = x1.iCount - liLastCount
>>   insert into production values ( ltElapsedTime, liElapsedCount, ltElapsedTime / liElapsedCount )
>>   ltLastTime = x1.tWhen
>>   liLastCount = x1.iCount
>>endscan
>>
>>
>>You can then scan through the production table looking for rows where iSecondsPerPiece exceeds some acceptable average value and flag these the "breaks" you want.
>>
>>>I have a table with fields: time, date, count. I am trying to seperate the table based on breaks in the time entries and the counts.
>>>
>>>As an example;
>>>
>>>
>>>Time Count
>>>12:36:55 0
>>>12:57:24 45
>>>15:43:08 389
>>>19:35:06 871
>>>20:00:00 872
>>>23:26:00 1339
>>>03:19:59 1836
>>>
>>>What I am trying to do is, seperate this table.
>>>I want my program to "see" the break between the (Time 19:35:06 Count 871) and (Time 20:00:00 Count 872). There is a visible Time/Count discrepency of nearly 25 minutes while producing only One extra piece. I want the counts between 0 and 871 seperated from the next set (872 and 1836).
>>>
>>>Can anyone lead me down the road to an answer? Or, if there is more information that I have left out, let me know. I will try to answer to the best of my ability.
Peter Cortiel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform