Topic: SQL search dates, From Sunday to Saturday, and count the dates
Hi everybody
I am attempting to do an SQL SEARCH such that I have a list of dates indicating the closure of client files. The quary is to see how many files have been closed during week periods. So that you could see that on any given weeks the quantity closed.
FROM TO QTY
2026-01-01 2026-01-07 32
2026-01-08 2026-01-14 12
Best I could manage with the little program and help from the net was the below, but i keep getting blocked :
table : reference
column : Datecompletion
grid : reports.Gridperformance (and the property i think is sqlvalue)
Any help would be amazing cause im starting to loose my mind.
Tks.
reports.GridPerformance.sqlValue := SQLExecute(
'SELECT ' +
' date(DateCompletion, ''-'' || ((strftime(''%w'', DateCompletion)+6) % 7) || '' days'') AS week_monday, ' +
' COUNT(*) AS total_in_week ' +
'FROM referalDb ' +
'GROUP BY week_monday ' +
'ORDER BY week_monday;'
);