For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > March 2006 > DateDiff Format









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DateDiff Format
Marty

2006-03-29, 7:06 pm

Is there a Format() function in Crystal? Something that can convert
DateDiff to "dd hh:mm" for a formula field? Thanks.

Marty

2006-03-29, 7:06 pm

I used a formula like this:

NumberVar n_mins := DateDiff("n",stratdate,enddate);
NumberVar n_hrs := Round(n_mins/60,0);
NumberVar n_mins2 := n_mins - n_hrs*60;

stringvar s_hrs := Left(ToText(n_hrs),Len(ToText(n_hrs))-3) + " hrs";
stringvar s_mins := Left(ToText(n_mins2),Len(ToText(n_mins2)
)-3) + "
mins";
s_hrs + ", " + s_mins

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com