Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.