I used the datediff function to calculate the number of days a training event has taken:
Datediff("d",[Training Date From],[Training Date To]+1
This works for calculating training in whole days but what I really need to do is calculate when a training event only lasts for half a day (from 9am until 12pm) and more importantly when training lasts for several whole working days and half a day on the last day of training (eg show result as 3 and a half days).
I have made the 'training date from' and 'training date to' fields into date/time fields. The main problem I have is getting the datediff function to ignore the hours outwith 9am - 5pm to return the correct result. I thought I could maybe somehow count the total training time in hours, discount the non-working hours and then convert the result to whole and half days. Is this in any way possible?!
Any help would be appreciated - even if its to say its impossible and I can tell my boss it can't be done!!
Thanks.
Datediff("d",[Training Date From],[Training Date To]+1
This works for calculating training in whole days but what I really need to do is calculate when a training event only lasts for half a day (from 9am until 12pm) and more importantly when training lasts for several whole working days and half a day on the last day of training (eg show result as 3 and a half days).
I have made the 'training date from' and 'training date to' fields into date/time fields. The main problem I have is getting the datediff function to ignore the hours outwith 9am - 5pm to return the correct result. I thought I could maybe somehow count the total training time in hours, discount the non-working hours and then convert the result to whole and half days. Is this in any way possible?!
Any help would be appreciated - even if its to say its impossible and I can tell my boss it can't be done!!
Thanks.