IO_Dork
asked on
Time Value difference in HTML Table
I have an HTML table that I have created inside a crystal report so that I can place it inside an email. One of the columns contains a formula that calculates the difference between CurrentDateTime and the timestamp field of the record being returned from the database. In order to display the field properly in the HTML table I had to do the following ToText() function, however instead of showing just 47min or even 00h 47min, it shows as 12h 47min. Of course, if the time difference is greater than 1 hour it properly shows as 1h 47min.
How can I remove the "12h" from being displayed when the time difference is less than 1 hour?
Crystal formula for time difference {@Pending Time}:
Time ((DateDiff ('n', {proposal.timestamp}, CurrentDateTime) / 60) / 24)
//DateDiff("n",{proposal.t imestamp}, Currentdat eTime)
HTML Code:
WhilePrintingRecords;
Stringvar HTML_Table;
HTML_Table:=HTML_Table+
"<tr>"+
//Here we add the Time column
"<td><div align=""center"">"+
ToText({@Pending Time},"hh'h' mm'min'")+
//Mid (ToText({@Pending Time}),1 ,5 )+
"</div></td>"+
"</tr>"
How can I remove the "12h" from being displayed when the time difference is less than 1 hour?
Crystal formula for time difference {@Pending Time}:
Time ((DateDiff ('n', {proposal.timestamp}, CurrentDateTime) / 60) / 24)
//DateDiff("n",{proposal.t
HTML Code:
WhilePrintingRecords;
Stringvar HTML_Table;
HTML_Table:=HTML_Table+
"<tr>"+
//Here we add the Time column
"<td><div align=""center"">"+
ToText({@Pending Time},"hh'h' mm'min'")+
//Mid (ToText({@Pending Time}),1 ,5 )+
"</div></td>"+
"</tr>"
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
FWIW, mlmcc's suggestion also works, at least partially, in that it would give you "00h 47min", instead of "12h 47min". 00h may not have been your first choice, but your post did sort of imply that that was acceptable (as an alternative to 12h).
Anyway, I'm not sure what would be "proper", but, FWIW, I do think that Ido deserves some points, and maybe mlmcc too. And I have no problem with you splitting the points, however you see fit.
James
Anyway, I'm not sure what would be "proper", but, FWIW, I do think that Ido deserves some points, and maybe mlmcc too. And I have no problem with you splitting the points, however you see fit.
James
There is no defined etiquette as such.
You are free to award the points as you see fit. It is customary when presented with several viable solutions to split the points in some way. You can provide Expert A (solution used) the BEST ANSWER and say 400 of the 500 points. Expert B gets 100 for providing a viable solution even if you never really pursued that path.
In some cases a solution may be viable but doesn't fit your criteria as spelled out in the question. In that case you could state that and not award any points or again provide a small portion to acknowledge the correctness of the solution.
EE is about solutions and answers to issues not effort so to simply award points to all participants would not be appropriate.
mlmcc
You are free to award the points as you see fit. It is customary when presented with several viable solutions to split the points in some way. You can provide Expert A (solution used) the BEST ANSWER and say 400 of the 500 points. Expert B gets 100 for providing a viable solution even if you never really pursued that path.
In some cases a solution may be viable but doesn't fit your criteria as spelled out in the question. In that case you could state that and not award any points or again provide a small portion to acknowledge the correctness of the solution.
EE is about solutions and answers to issues not effort so to simply award points to all participants would not be appropriate.
mlmcc
ASKER
thanks for the clarification.
ASKER
Thanks