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

get rid of seconds in display

Status
Not open for further replies.

jmfox2

Programmer
Jan 24, 2003
7
US
trying to create field that looks like: 1500(12.5) to represent start shift time and the duration of the shift.

I have shiftstartdate shiftstarttime, shiftenddate, shiftendtime that are datetime fields.

hour(shiftstarttime) &"("& datediff('h',shiftstarttime,shiftendtime)

getting 1500.00(12.00) want 1500(12.5)

any ideas would be greatly appreciated.
 
Try:

totext(hour(shiftstarttime)*100,0,"") +"("+ totext(datediff('n',shiftstarttime,shiftendtime)/60,1)

I added *100 to the hour portion as I couldn't see how you could use the hour function and have it return 1500 (for 3PM) without that.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top