Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select help
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00153136
Message ID:
00153791
Vues:
29
Virusim and Vlad,
I got the dbf file you sent me, see if the following works for you.


SELECT emp_id, DTOC(in_time) as The_Date, ;
TTOC(in_time,2) as in_time, late ;
FROM timetest a WHERE TTOC(in_time,2) IN( ;
SELECT MIN(TTOC(in_time,2)) ;
FROM timetest b WHERE a.emp_id=b.emp_id ;
AND DTOC(in_time)= DTOC(b.in_time) ;
) ;
INTO CURSOR MinValues

SELECT emp_id, DTOC(out_time) as The_Date, ;
TTOC(out_time,2) as out_time, overtime ;
FROM timetest a WHERE TTOC(out_time,2) IN( ;
SELECT MAX(TTOC(b.out_time,2)) ;
FROM timetest b WHERE a.emp_id=b.emp_id ;
AND DTOC(out_time)=DTOC(b.out_time) ;
) ;
INTO CURSOR MaxValues

SELECT a.emp_id, a.the_date, a.in_time, b.out_time, a.late, b.overtime ;
FROM MinValues a, MaxValues b ;
WHERE a.emp_id=b.emp_id AND a.the_date=b.the_date ;
INTO CURSOR SomeResult
Roxanne M. Seibert
Independent Consultant, VFP MCP

Code Monkey Like Fritos
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform