Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select and sum
Message
From
20/06/2005 16:12:10
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01024603
Message ID:
01024937
Views:
24
hi,
thank you, it works but with defrent result mean if i have second as
under 540600 i get this number via code without Sec2Str

with Sec2Str the result is 06:10:00,
if i divide twice manualy at 60 as
A=540600/60=9010
A=A/60=150:16


>There're many ways to convert seconds to HH:MM:SS format. Try
...
>	Sec2Str(SUM(IIF(MONTH(dat)=1 AND typ = 1, INT(CTOT(true) - CTOT("00:00")), 000000))) AS m1_m, ;
>	Sec2Str(SUM(IIF(MONTH(dat)=1 AND typ = 2, INT(CTOT(true) - CTOT("00:00")), 000000))) AS m1_a, ;	
>...
>
>...
>FUNCTION Sec2Str
>LPARAMETERS tnSeconds
>RETURN TRANSFORM( RIGHT( TTOC(CTOT("00:00") + tnSeconds,1), 6), "@R 99:99:99")
>
>>thank you very much, it works but...
>>i need to change  seconds to hours and minuts inside the code
>>how i can sum m1_m,m2_m ....m12_m to new field
>>and sum  m1_a, m2_a.........m12_1 to new filed
>><pre>
>>CLOSE all
>>USE table1
>>INDEX ON  divi TO kk
>>m.dat1=ctod("01/01/2005")
>>m.dat2=ctod("01/31/2005")
>>SELECT divi, mac1, ;
>>	SUM(IIF(MONTH(dat)=1 AND typ = 1, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m1_m, ;
>>	SUM(IIF(MONTH(dat)=1 AND typ = 2, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m1_a, ;	
>>	SUM(IIF(MONTH(dat)=2 AND typ = 1, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m2_m, ;
>>	SUM(IIF(MONTH(dat)=2 AND typ = 2, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m2_a, ;	
>...
>>    SUM(IIF(MONTH(dat)=11 AND typ = 1, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m11_m, ;
>>	SUM(IIF(MONTH(dat)=11 AND typ = 2, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m11_a, ;	
>>	SUM(IIF(MONTH(dat)=12 AND typ = 1, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m12_m, ;
>>	SUM(IIF(MONTH(dat)=12 AND typ = 2, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m12_a ;	
>>FROM table1 ;
>>WHERE dat BETWEEN m.dat1 and m.dat2 ;
>>GROUP BY 1,2
>>**skip
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform