Oct 12, 2022 12:56 PM
Hi all!
I have a question about a formula field. In one of my bases, I have time sheets with the following fields :
The Total time field has the following formula : DATETIME_DIFF({Fin affectation},{Début affectation},‘minute’)
I can’t figure out what to put in the formula to substract the lunch time from the overall hours. Can someone help me? :slightly_smiling_face:
Thank you!
Oct 12, 2022 02:25 PM
From your description I think you are trying to add a fifth column that is “total time excluding lunch break”?
Make sure the “Lunch break (total time in minutes)” field is of type “Number”. Then in this new column you can simply use the formula:
{Temps pour feuille} - {Période temps de repas}
Oct 12, 2022 04:49 PM
Hi Nathaniel!
In fact, I was trying not to add a new field to keep the base as simple as possible, but it does make sense to add a new field and just hide the one that adds up the total time of the day. Thanks for the advice!
Oct 12, 2022 04:55 PM
Ah!
You can do it either way. This formula will do all the work in one step:
DATETIME_DIFF({Fin affectation},{Début affectation},‘minutes’) - {Période temps de repas}
Do make sure that the “Période temps de repas” is of type Number
Oct 13, 2022 06:22 AM
Great!
It is exactly what I was looking for, but I was putting Période temps de repas at the wrong place (before ‘minutes’). So everything is working just fine. Thank you very much!