zelarra821
Registered User.
- Local time
- Today, 18:32
- Joined
- Jan 14, 2019
- Messages
- 843
Good afternoon.
I have a table with start and end times for work, and, in between, stops for breakfast and lunch.
I have created a dropdown with the type of time record: entry, breakfast start, breakfast end, lunch start, lunch end, and output.
Now what I have to do is subtract:
breakfast start - Entry
-------------------------------------------------- -------------------
If((breakfast end - breakfast start)>0.0208333333333333;0.0208333333333333;breakfast end - breakfast start)
0.0208333333333333 equals half an hour
-------------------------------------------------- -------------------
Start lunch - breakfast end
either
Output - breakfast end
depending on whether it exists start lunch
-------------------------------------------------- -------------------
If((End lunch-Start lunch)>0.02083333333333333;0;(End lunch-Start lunch)-0.0208333333333333)
-------------------------------------------------- -------------------
Departure - End of meal
I've created a function, and what I was trying to achieve is to create an array with the hours and the type, and then loop through it, but I'm not able to. It is also true if what I have thought is the most optimal, that is why I am asking if someone can help me and/or suggest something more functional and faster.
I leave you the database.
Thank you so much.
I have a table with start and end times for work, and, in between, stops for breakfast and lunch.
I have created a dropdown with the type of time record: entry, breakfast start, breakfast end, lunch start, lunch end, and output.
Now what I have to do is subtract:
breakfast start - Entry
-------------------------------------------------- -------------------
If((breakfast end - breakfast start)>0.0208333333333333;0.0208333333333333;breakfast end - breakfast start)
0.0208333333333333 equals half an hour
-------------------------------------------------- -------------------
Start lunch - breakfast end
either
Output - breakfast end
depending on whether it exists start lunch
-------------------------------------------------- -------------------
If((End lunch-Start lunch)>0.02083333333333333;0;(End lunch-Start lunch)-0.0208333333333333)
-------------------------------------------------- -------------------
Departure - End of meal
I've created a function, and what I was trying to achieve is to create an array with the hours and the type, and then loop through it, but I'm not able to. It is also true if what I have thought is the most optimal, that is why I am asking if someone can help me and/or suggest something more functional and faster.
I leave you the database.
Thank you so much.