--- In vantage@yahoogroups.com, Bartosz Niemczewski
<bartoszniemczewski@...> wrote:
22:26. I try to do it in Crystal Reports.
CStr(RoundUp(({FirstArt.ActionTime}/3600,0) - 1, "##") & ":" &
CStr(Round((Remainder({FirstArt.ActionTime}, 3600) / 3600) * 60 , 0) ,
"##")
To explain:
The RoundUp function with 0 decimal places will always round to the
next whole number. This is the reason that 1 must be subtracted from it.
The value of the RoundUp is placed in the CStr function with the "##"
format string to give you a two digit number - in this example 21.
The Remainder function would give you 2806 after 78406 is divided by
3600. That value needs to be divided by 3600 to give you a decimal
value (in this case .794) which needs to be multiplied by 60 to give
you the actual number of minutes left over. The Round function
applied to the Remainder function will round it to a 2 digit whole
number (in this case 47) and the CStr will give you a 2 digit
formatted number.
Those two value are concatenated together with a colon to give you
21:47 which is the correct value for 78406.
<bartoszniemczewski@...> wrote:
>table looks like that : 78406 , how to change for time , like example
> Hello,
> I have a question about table {FirstArt.ActionTime}, values in this
22:26. I try to do it in Crystal Reports.
>Try the following as a formula field in Crystal Reports:
> Thank you.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> [Non-text portions of this message have been removed]
>
CStr(RoundUp(({FirstArt.ActionTime}/3600,0) - 1, "##") & ":" &
CStr(Round((Remainder({FirstArt.ActionTime}, 3600) / 3600) * 60 , 0) ,
"##")
To explain:
The RoundUp function with 0 decimal places will always round to the
next whole number. This is the reason that 1 must be subtracted from it.
The value of the RoundUp is placed in the CStr function with the "##"
format string to give you a two digit number - in this example 21.
The Remainder function would give you 2806 after 78406 is divided by
3600. That value needs to be divided by 3600 to give you a decimal
value (in this case .794) which needs to be multiplied by 60 to give
you the actual number of minutes left over. The Round function
applied to the Remainder function will round it to a 2 digit whole
number (in this case 47) and the CStr will give you a 2 digit
formatted number.
Those two value are concatenated together with a colon to give you
21:47 which is the correct value for 78406.