PDA

Click to See Complete Forum and Search --> : [RESOLVED] Keeping output from a formula aligned.


ezzy85
Feb 5th, 2006, 05:51 PM
I have a formula which outputs a time bewteen 2 dates in the format Days Hours Minutes. I have a formula which calculates this and this is the line for the output:

truncate(dd) & " D " & truncate(hh) & " H " & truncate(mm) & " M";

However, if there is a day or hour with 2 digits, the alignment screws up and it looks ugly. What would be the best way to fix this?
Thanks

Tribo
Feb 5th, 2006, 06:43 PM
Try entering something like this: (Use DateTime because you need Days Hours and Minutes and format it with CStr)

Cstr( DateTime(Datediff("d",CDate({@Fecha1}) , CDate({@fecha2}))),"dd ' D ' hh ' H ' mm ' M'")

I attach a .rpt file.

I expect it may help you.

Regards,
Tribo

ezzy85
Feb 5th, 2006, 07:02 PM
thank you for that