korytnackaruzova
Technical User
Hi.
I'm working on a query in SQL. I have datetime A and datetime B. I calculated the time difference between them. And now the fun part starts.
I need to round down the time difference to every 15 minutes. I partially figured out the round down part, except, it's rounding minutes in the time difference only. So for some incidents the time difference 00:44:18 rounds to 00:45:00 (I would need that to be 00:30:00).
The second part is to calculate the cost. Each 15 minutes can be billed 5. In example:
30 minutes 5
45 minutes 10
1:15 minutes 20
1:45 minutes 30
2:30 minutes 40
Any advice would be truly appreciated! Thank you!
I'm working on a query in SQL. I have datetime A and datetime B. I calculated the time difference between them. And now the fun part starts.
I need to round down the time difference to every 15 minutes. I partially figured out the round down part, except, it's rounding minutes in the time difference only. So for some incidents the time difference 00:44:18 rounds to 00:45:00 (I would need that to be 00:30:00).
The second part is to calculate the cost. Each 15 minutes can be billed 5. In example:
30 minutes 5
45 minutes 10
1:15 minutes 20
1:45 minutes 30
2:30 minutes 40
Any advice would be truly appreciated! Thank you!