Question : I am struggling to query for a specific time frame between 21:50 and 21:59: SELECT Username, EventTime, EventsEx.FirstName, […]
Tag: date-math
Office Hours in PostgreSQL
Question : How to store office hours in PostgreSQL rows, so that I can calculate the office hours. Example: We […]
How does date math work in SQL Server?
Question : I often see queries written with DATEADD and DATEDIFF in the WHERE clause to define a range, flatten […]
Multiply and divide dates
Question : I had a recent DBA.SE question that involved dates that were used as the x-axis in a graph: […]
How can I use mysql to determine the Sundays for the last year?
Question : I have a table where I’m currently aggregating ~200 rows per day of stats. These stats include things […]
Merge Only Events that Start immediately after the Previous Event without any Gap
Question : How can i merge only the dates occur subsequently.? (i.e, The Next Event begins immediately after the previous […]
Explode a date range
Question : I have the following table with the following data: DECLARE @MyActions TABLE (ActionId INT NOT NULL, ActionDate DATETIME […]
Sum date between two date and group by month
Question : I have a table as below: Name Start Date End Date Joe 20/04/2021 20/05/2021 John 01/05/2021 28/05/2021 I […]
Calculate days between to dates postgresql
Question : I’m having a problem: I’m trying to calculate days between two dates. Let’s say I have the date […]
Getting the first Monday after the third Friday
Question : I have seen on this site how to get the the third Friday of the month: select quote_date […]
- 1
- 2