cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports Help Needed

Former Member
0 Kudos

Hi All,

I have a time like this 12 :30 :30 type is string.

Now I want like this  12.05

Here minutes should devide by seconds and then hours shuld devide by resultant minutes.

Please help

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Divya,

Could you provide a few more examples of this please?

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

Suppose my time is 22:30:30

I need to show 22.5    (Here 30/60=0.5 and that should show after hours .)

ido_millet
Active Contributor
0 Kudos

stringvar array TimeArray := Split({Your_Time_String},":");

TimeArray[1] & "." & cstr((100*cdbl(TimeArray[2]) + cdbl(TimeArray[3]))/60,0);

Message was edited by: Ido Millet

former_member205840
Active Contributor
0 Kudos

Hi Divya,

Can you try below :

stringvar t:="12:30:30";

left(t,2)&":"&left(replace(totext((tonumber(mid(t,instr(t,':')+1,2))/60)),'.',''),2)

Assign your field to 't' variable.

Thanks,

Sastry

Former Member
0 Kudos

Hi Sastry,

I tried above formula as it is to test.But it should display 12.5 as per my requirement.

Now I am getting 12.1

Please suggest

former_member205840
Active Contributor
0 Kudos

Hi Divya

can you try below

Timevar t:=time("12:30:30");

Totext(Hour(t),"00")&':'&Totext(Minute(t)/60*10,"00")

-Sastry

Former Member
0 Kudos

Hi Sastry,

Thanks.

I am getting the result now.Can you please let me know why you are multiplying 60 with 10.

Timevar t:=time({@t});

 

Totext(Hour(t),"00")&':'&Totext(Minute(t)/60*10,"00")

former_member205840
Active Contributor
0 Kudos

Hi Divya,

I am multiplying the results by 10 to shift first decimal place to integer part Eg : 00.50 to 05.

In the time stamp you can't display decimal places and you should have integer.

= 30/60 = 00.50*10 will give us 05.

Thanks,

Sastry

Answers (0)