Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL syntax help
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL syntax help
Divers
Thread ID:
00868355
Message ID:
00868355
Vues:
61
Hi,

Is there adequate SQL syntax for the next problem.

One table InOut. It contains information when employer is logged in and out from the work. During one day employer can log multiple time in and out. All timestamps (datetime) when logged in and out is converted to the seconds (UDF) since midnight and summed togethere to get total seconds in work which is then calculated and converted to hours for the report.
Sys(3009,70)
Select Inout.cid, InOut.tdate, InOut.iInOrOut...;
  Sum(tToSec(InOut.tdate)*iif(InOut.iInOrOut=1,1,0)) As Sum_In, ;
  Sum(tToSec(InOut.tdate)*iif(InOut.iInOrOut#1,1,0)) As Sum_Out, ;
...
Where InOut.tdate>=m.tStart AND ;
InOut.tdate<=m.tEnd ;
Group By InOut.tdate, InOut.cid
.
Now I have to have a field there to to show how many days employers has been in work between m.tStart and m.tEnd. Using plain Count may not be the option (?) because he/she can be logged in/out multiple time (one log is one record) per day.

AT
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform