Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select and sum
Message
De
18/06/2005 12:58:14
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Select and sum
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01024603
Message ID:
01024603
Vues:
77
hi all,

my table have fields
divi type character
dat type date && i need month(dat) as 1,2,3...
mac1 type character
typ type numaric as 1 mean the morning period 2 the aftrnon period
true type hh:mm

i need to create cursor have result as under

morning mean sum field true if typ=1
aftrnoon mean sum field true if typ=2
divi    mac1    month 1                 month2 ...........to month12       
              morning   aftrnon    morning   aftrnoon
aa      eo4   166:33    109:15     145:10    170:45  .........
aa      eo3   
bbb     jo7 
bbb     jo6
www      .
.        .
.        .
.        .
 ---------------------------------------------------------------
total       166:33.....................................
this code under to sum field true as hh:mm
SUM CTOT(true) - CTOT("00:00:00") to lnSec
SUM VAL(LEFT(true,2))*3600 + ;
	VAL(SUBSTR(true,4,2))*60 + ;
	VAL(RIGHT(true,2)) TO lnSec
lnSec11=lnSec

true= PADL(INT(lnSec/3600),4, "0") + ":" + ;
				PADL(INT((lnSec%3600)/60),2, "0") 
thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform