Question:
How does one calculate time differences. I know there’s a function to calculate date differences.I am coding a database program which includes calculating the difference between a start time and a finish time.
Answer:
Even though it is called the DateDiff function, it can be used to calculateup to second differences between two date/time values. All you have to dois change the first argument, which is the interval argument, to one of thefollowing codes:
- yyyy – Year
- q – Quarter
- m – Month
- y – Day of year
- d – Day
- w – Weekday
- ww – Week
- h – Hour
- n – Minute
- s – Second