Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Integer to DateTime

Status
Not open for further replies.

shanewiso

Programmer
Joined
Jul 20, 2005
Messages
5
Location
AU
One last question about Crystal and Formatting, Can I achieve this.....;

I have a result of data that returns total minutes worked as an integer value.

i.e.
Date Mins
1/7/2005 400
2/7/2005 600
3/7/2005 520
4/7/2005 500
Total mins = 2020

Using Crystal Reports, I want to covert and more importantly format the integer values to hours worked, how can i do this using a crystal function(s)?

The result should give me in hrs worked:
Results
6:40
10:00
8:40
8:20
Total 33:40

Crystal should be able to display the values as above. And if the minutes are Negitive, then a minus should be placed in front of the figure.


 
Try ToDate({your.field}) and see what you get. If may turn it into date-time format, in which case you could get the time using ToText((ToDate({your.field})), "hh:mm"), something like that.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Try:

totext(truncate({@minutes}/60),0,"") + ":" + totext(remainder({@minutes},60),0,"")

You would need to use a separate formula for the summary section:

totext(truncate(sum({@minutes}, {table.group})/60),0,"") + ":" + totext(remainder(sum({@minutes}, {table.group}),60),0,"")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top