Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Idea on creating time record report on a graveyard shift
Message
 
 
À
23/09/2003 22:26:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00831723
Message ID:
00831729
Vues:
28
>does anyone have any idea on how i can create a daily time record of an employee on a grave yard shift? say from 11PM-7AM.
>
>i have a table with these sample data,
>
>
>swipedate  time
>04/01/2003 2210
>04/02/2003 0730
>04/02/2003 2245
>04/03/2003 0701
>04/03/2003 2250
>.
>.
>.
>.
>
>
>
>
>the report should look like this,
>
>
>
>   date       timein     timeout
>04/01/2003    22:10      07:30
>04/02/2003    22:45      07:01
>04/03/2003    22:50
>
>
Do you have any gaps in the data? If not, you can use just scan the table, e.g.
Create cursor ToReport (DateIn D, TimeIn C(5), TimeOut C(5))
select maintable
set order to swipedt
scan
  if mod(recno(),2) = 1
     insert into ToReport (DateIn, TimeIn) values (SwipeDate,left(time,2)+":"+right(time,2))
  else && even record
     replace timeout with (time,2)+":"+right(time,2) in ToReport
  * or use scatter field command
  endif
endscan
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform