Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Want to show mm:ss on chart label, not seconds?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Divers
Thread ID:
00674011
Message ID:
00675118
Vues:
21
Steve,

Can you output this as a character field? If so you can use ttoc():

set hours to 24
t1 = datetime()
t2 = t1 + int( rand() * 3600 )
lnElapsed = t2 - t1
lcMMSS = right( ttoc( {^2002-01-01 00:00:00} + lnElapsed ), 5 )
? lcmmss, lnElapsed

>Here's a formula I use to calculate seconds between two times. I want to show the seconds as minutes:seconds instead of seconds both in the text below the chart and in the label of the chart too. I was thinking I might try using the Time(0,0,0) formula to get hh:mm:ss, but I did not get the result I wanted. I could write my own formula that converts it into minutes and seconds using divide by 60, but I figured Crystal would have a built-in function I could use instead, but I still have my doubts about minutes and seconds appearing on the bar chart label and axis labels. Here's my formula. Thanks very much.
>
>
>If IsTime ({master.T_FA_ATPT}) and IsTime ({master.T_SHOCK}) and
>  {master.shock_agcy} = "FD ALS" then
>  NumberVar totalsec:=Time({master.T_SHOCK})-Time({master.T_FA_ATPT});
>
>If IsTime ({master.T_FB_ATPT}) and IsTime ({master.T_SHOCK}) and
>  {master.shock_agcy} = "FD BLS" then
>  NumberVar totalsec:=Time({master.T_SHOCK})-Time({master.T_FB_ATPT});
>
>If IsTime ({master.T_FA_ATPT}) and Not IsTime ({master.T_FB_ATPT}) and IsTime ({master.T_SHOCK}) then
>  NumberVar totalsec:=Time({master.T_SHOCK})-Time({master.T_FA_ATPT});
>
>If Not IsTime ({master.T_FA_ATPT}) and IsTime ({master.T_FB_ATPT}) and IsTime ({master.T_SHOCK}) then
>  NumberVar totalsec:=Time({master.T_SHOCK})-Time({master.T_FB_ATPT});
>totalsec;
>
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform