Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with a do while loop
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00985799
Message ID:
00985810
Views:
31
This message has been marked as a message which has helped to the initial question of the thread.
Phil,
create cursor x1 ( wo i, punch d )

insert into x1 values ( 1, {^2005-1-1} )
insert into x1 values ( 1, {^2005-1-6} )
insert into x1 values ( 1, {^2005-1-8} )
insert into x1 values ( 2, {^2005-1-3} )
insert into x1 values ( 2, {^2005-1-6} )

select wo, ( max( punch ) - min( punch ) ) + 1 as duration ;
   from x1 ;
   into cursor howlong ;
   group by wo
filtering out weekends from the duration is a lot rougher. I'll work some more on that later this evening.

>I have a file with individual labor punches on work orders.
>
>WO  Date
>1   1/1/05
>1   1/6/05
>1   1/8/05
>2   1/3/05
>2   1/6/05
>etc
>
>I want to calculate the number of days each work order was open by looping through the records. I am struggling with is how to do this for each work order and then output the work order number and cycle time days to a second table for reporting. The cycle time has to include the start and stop day too.
>
>Work Order Cycle Time
>1 8
>2 4
>
>As a secondary question - is there an easy way to count only WEEKDAYS?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform