Forum Discussion
Taking 30 minutes off a time
Hi,
If it is really just about what you have in the subject, then
DateAdd("n","-30", [YourTimeField])
Servus
Karl
************
Access News
Access DevCon
I have the start time and the finish time and have then worked out the hours worked. (08:00-16:00 = 8). This is held in another field for ease. I then need to take off x minutes depending on customer.
I have brough through the customers minutes to be deducted.
Set Thisdb = CurrentDb
Set Recs = Thisdb.OpenRecordset("QryCustomersDepotsSingleDepot", dbOpenDynaset)
Set Bookings = Thisdb.OpenRecordset("QryBookingSingleBooking", dbOpenDynaset)
Set UpdateHrs = Thisdb.OpenRecordset("QryTimeDiffUpdate", dbOpenDynaset)
UpdateHrs.MoveFirst
HrsLeft = UpdateHrs!Hrs
Recs.MoveFirst
ThisCustomer = Bookings!BCustomer
Set CDBreak = Thisdb.OpenRecordset("QryCustomerDepotsSingleDepot", dbOpenDynaset)
RateTimeStart = Recs!CDWHRate1Text
RateTimeEnd = Recs!CDWHRate2Text
CDBreak.MoveFirst
BreakTime = CDBreak!CDBreakTimeDed
If BreakTime = "0.5" Then
BreakTimeMins = "00:30"
Dateadd("n",-30,[hrsleft])
Thanks for your help Karl