Generally values like that are 14 hours and .9 of an hour or 54 minutes so it it 14:54

If it really is 15.30 then what is 15.3 in your database?

mlmcc

Solved

Posted on 2009-02-09

for example if i have decimal value : 14.90

i need to get the time value that is : 15.30 HH.MM

how can i do it in the report ?

thanks

i need to get the time value that is : 15.30 HH.MM

how can i do it in the report ?

thanks

14 Comments

Generally values like that are 14 hours and .9 of an hour or 54 minutes so it it 14:54

If it really is 15.30 then what is 15.3 in your database?

mlmcc

from the 90 min we have 1 hour + 30 min

so we have 14 + 1.30 = 15.30

this is waht i need to calc

i hope that u help me...

Assuming @time1 is the original time value,

floor({@time1},1) + floor((({@time1} - floor( {@time1})) * 100 / 60))

+

(

(

({@time1} - floor( {@time1})) * 100 -

(floor(({@time1} - floor( {@time1})) * 100/60) * 60)

)

/ 100

)

It SEEMS to work....

floor(Sum ({Msam.TotalHour}),1) + floor(((Sum ({Msam.TotalHour}) - floor( Sum ({Msam.TotalHour}))) * 100 / 60))

+

(

(

(Sum ({Msam.TotalHour}) - floor( Sum ({Msam.TotalHour}))) * 100 -

(floor((Sum ({Msam.TotalHour}) - floor( Sum ({Msam.TotalHour}))) * 100/60) * 60)

)

/ 100

)

but i am geting this message :

The remaining text does not appear to be part of the formula.

For one thing, you have 3 right parens on the end of your first line, where I have 2....

can u type it in youer forumla and send it here fix?

thanks ..

Then just use my formula.

floor({@time1},1) + floor((({@time1} - floor( {@time1})) * 100 / 60))

+

(

(

({@time1} - floor( {@time1})) * 100 -

(floor(({@time1} - floor( {@time1})) * 100/60) * 60)

)

/ 100

)

and i put youer code into

then i drag the calc formula into the report

when i run the report i am geting this Exsption :

Error in File C:\DOCUME~1\simon\LOCALS~1

Error in formula <@Calc>.

'floor({@time1},1) + floor((({@time1} - floor( {@time1})) * 100 / 60))

'

The remaining text does not appear to be part of the formula. ---> System.Runtime.InteropServ

Error in File C:\DOCUME~1\simon\LOCALS~1

Error in formula <@Calc>.

'floor({@time1},1) + floor((({@time1} - floor( {@time1})) * 100 / 60))

'

The remaining text does not appear to be part of the formula.

You should use Crystal syntax.

Here is a slightly easier formula

local numbervar time1 := {@time1};

local numbervar hours1;

local numbervar minutes1;

hours1 := truncate(time1);

minutes1 := time1 - hours1;

minutes1 := minutes1 * 100;

if minutes1 >= 60 then

(

hours1 := hours1 + 1;

minutes1 := minutes1 - 60;

);

hours1 + minutes1/100

mlmcc

By clicking you are agreeing to Experts Exchange's Terms of Use.

Title | # Comments | Views | Activity |
---|---|---|---|

Crystal Report fractions | 4 | 48 | |

Crystal 2013 - Using Can Grow adds spaces in text | 9 | 40 | |

Change start of Week from Sunday to Friday | 8 | 36 | |

What is the best report viewer for Crystal Reports in ASP.Net using vb.net/C# | 2 | 51 |

Join the community of 500,000 technology professionals and ask your questions.

Connect with top rated Experts

**14** Experts available now in Live!