Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select and sum
Message
From
18/06/2005 12:58:14
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Select and sum
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01024603
Message ID:
01024603
Views:
74
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
Next
Reply
Map
View

Click here to load this message in the networking platform