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

More than 24 hours

Status
Not open for further replies.

teeth

Technical User
Jan 18, 2002
10
GB
I am creating a database to generate monthly timesheets and most employees work more than 24 hours in a month. I have time in / time out. and a field that calulates the difference. Can i convert the difference into a 'number' and then use the number to caluclate the number of hours and then the number of minutes. Employees only ever work in multiples of 15, 30, 45 and 60 minutes. I have had no experience of 'code'. Please help, ask me for more information if you need before you help me.

Many thanks
Chris B
 
Hallo,

That would depend whether you are using date/time data types or just numbers. I'll guess just numbers, and I'll assume that they enter the data in decimal hours, ie. 25.5 is 25 hours, 30 minutes

Try:
Code:
Dim dblDiff as double
dim intHours as integer
dim intMinutes as integer

dblDiff = val(Nz(me!txtDifference,0))
intHours = int(dblDiff)
intMinutes = 60*(dblDiff-intHours)

That might work,

- Frink
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top