Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select help
Message
De
31/10/1998 03:02:29
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
SQL Select help
Divers
Thread ID:
00153136
Message ID:
00153136
Vues:
57
Hi,

I had a table with data which I like to get only the first record of the lateness field and the last record of overtime field like

Table data

Emp_ID Date Time_in Time_out Latness Overtime
=================================================

20001 01/10/98 09:00 17:00 01:00 00:00
20001 01/10/98 10:00 19:00 00:00 02:00
20001 01/10/98 12:00 20:00 00:00 03:00

20002 01/10/98 08:00 17:00 00:00 00:00
20002 01/10/98 10:00 19:00 00:00 02:00


using SQL command to get table like (extract out only the first record latness field and last record overtime field)

Emp_ID Date Time_in Time_out Latness Overtime
=================================================
20001 01/10/98 09:00 20:00 01:00 03:00
++++++++++++++
20002 01/10/98 08:00 19:00 00:00 02:00

I had tried to use the SQL MIN and MAX, but due to some inconsistence data in the latness/overtime fields, it give me wrong result.

How do I specify in the SQL command so that I get only the first
latness field of the first records and get the overtime field of
the last records.


Any help or suggestion with examples is very much appreciated. Thank in advance.













Best Regards
Virusim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform