Crystal Reports & AUDTTIME

Hi

We are using SAGE 300 and crystal reports 10.  I've been strugling with this issue form more than 8 hours now and I really need help.  The AUDTTIME field in ICHIST is a decimal(9) field.  Now I've got to convert this decimal field to a time.    This is my code:

Local NumberVar TheHour;
Local NumberVar TheMin;
If length(ToText({ICHIST.AUDTTIME})) = 13 Then
TheHour := ToNumber(Left(ToText({ICHIST.AUDTTIME}),2))
else
TheHour := ToNumber(Left(ToText({ICHIST.AUDTTIME}),1));

If length(ToText({ICHIST.AUDTTIME})) = 13 Then
TheMin := ToNumber(mid(ToText({ICHIST.AUDTTIME}),3,2))
else
TheMin := ToNumber(Mid(ToText({ICHIST.AUDTTIME}),1,2));
Time(TheHour,TheMin,00);

For example if the value in the field is 11151535 the time should display 11:15 but it displays 11:01:00.

I really don't know anymore what I am doing wrong and can not afford any more time on this issue.  

Help will be greatly appreciated!

Parents Reply Children