Skip to content
Advertisement

Is it preferred to use end-time or duration for events in sql? [closed]

My gut tells me that start time and end time would be better than start time and duration in general, but I’m wondering if there are some concrete advantages or disadvantages to the differing methods.

The advantage for strttime and endtime I am seeing is that if you want to call all events active during a certain time period you don’t have to look outside that time period.

(this is for events that are not likely to change much after initial input and are tied to a specific time, if that makes a difference)

Advertisement

Answer

End – Start = Duration.
One could argue you could even use End and Duration, so there really is no difference in any of the combinations.

Except for the triviality that you need the column included to filter on it, so include

  • duration: if you need to filter by duration of execution time
  • start + end: if you need to trap for events that both start and end within a timeframe
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement