The starting and ending time in SQL for users who work overnight shifts or stay logged in after midnight depends on the specific definition of their working hours.
One approach could be to use a 24-hour clock and assign midnight as the start time for the day. In this case, a user working an overnight shift from 10:00 PM to 6:00 AM would have a starting time of 22:00 and an ending time of 6:00.
Another approach could be to use a more flexible time range and allow for overlapping days. For example, a user who logs in at 11:00 PM and stays logged in until 2:00 AM the following day could have a starting time of 23:00 and an ending time of 2:00.
Ultimately, the specific approach will depend on the needs of the system and the way in which users' working hours are defined.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-12-04 11:00:00 +0000
Seen: 8 times
Last updated: Jul 09 '21
How do you log Python data into a database?
How can the SQL debug mode be activated in PostgreSQL version 15.2?
How to deal with an operational error when connecting Django to MySQL?
What is the method for choosing data FROM a stored procedure?
How can SQL/PLSQL blocks be stripped of their comments?
What is the process for initializing Java UDFs in Spark?
How to set up Database First configuration in Entity Framework 7 for MVC 6?