Calculate end time. (1 Viewer)

es2021

New member
Local time
Today, 18:17
Joined
Nov 27, 2021
Messages
2
I am doing an A-Level IT project within MS Access for a spa. I would like the end time field to be automatically calculated when I put in a start time, I have a time duration field for each treatment. I'd imagine I would need to have a calculated field for the end time which adds treatment duration onto treatment start time giving me the end time. I'm just not sure how I would write such a calculation. Thanks.
 

bob fitz

AWF VIP
Local time
Today, 18:17
Joined
May 23, 2011
Messages
4,719
I am doing an A-Level IT project within MS Access for a spa. I would like the end time field to be automatically calculated when I put in a start time, I have a time duration field for each treatment. I'd imagine I would need to have a calculated field for the end time which adds treatment duration onto treatment start time giving me the end time. I'm just not sure how I would write such a calculation. Thanks.
Take a look at the dateadd() function. Use it to create a calculated field in a query which can then be used as the record source for a form. Do not keep the calculation in a table field.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:17
Joined
Oct 29, 2018
Messages
21,454
Hi. Welcome to AWF!

I agree, don't store the calculated values and use DateAdd() to calculate them.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 13:17
Joined
Feb 19, 2002
Messages
43,227
Normally, I would agree that you shouldn't store a calculated value but this is an estimate, not a final result and it might be needed for scheduling. See if the calculation in the query works for you before you try to store the value.
 

Users who are viewing this thread

Top Bottom