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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

time round

Status
Not open for further replies.

neskin

Programmer
Mar 13, 2002
104
AU
hi,
I have datetime field from oracle db
01/01/1000 5:59:59AM
01/01/1000 10:59:59PM
How can i round the time to display in crystal xi

0600
2300

thank you in advance
nat
 
You've already asked this question once. If there was something wrong or unclear about the replies, please post there.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
it was nothing wrong I have used your and lbass formulas. thank you for that .The question a bit different to previous so i thought it would be better to post a new question.next time i'll post as the same question

Thank you
 
If you've got the rounded time, then you can display its parts using ToText. In this case
Code:
ToText(@RoundTime, "HHmm")
.

When you've solved part of a problem already, it's good to say so. Also to mention anything you've tried which has not worked, so no one wastes time suggesting it.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Try a formula like:

numbervar hrs := datediff("s",datetime(date({table.datetime}),time(0,0,0)),{table.datetime})/3600;
totext(round(hrs)*100,"0000")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top