support for new SQL Function DATE_BUCKET
Please add support for new SQL Functions such as DATE_BUCKET
https://learn.microsoft.com/en-us/sql/t-sql/functions/date-bucket-transact-sql?view=sql-server-ver16
Currently it get quoted which is quite inconvenient.
declare @date datetime2 = '2020-04-30 21:21:21'
Select 'Week', DATE_BUCKET(WEEK, 1, @date)
Union All
Select 'Day', DATE_BUCKET(DAY, 1, @date)
Union All
Select 'Hour', DATE_BUCKET(HOUR, 1, @date)
Union All
Select 'Minutes', DATE_BUCKET(MINUTE, 1, @date)
Union All
Select 'Seconds', DATE_BUCKET(SECOND, 1, @date);
becomes
DECLARE @date DATETIME2 = '2020-04-30 21:21:21';
SELECT 'Week', [DATE_BUCKET] ( [WEEK], 1, @date )
UNION ALL
SELECT 'Day', [DATE_BUCKET] ( [DAY], 1, @date )
UNION ALL
SELECT 'Hour', [DATE_BUCKET] ( [HOUR], 1, @date )
UNION ALL
SELECT 'Minutes', [DATE_BUCKET] ( [MINUTE], 1, @date )
UNION ALL
SELECT 'Seconds', [DATE_BUCKET] ( [SECOND], 1, @date );
this is incorrect and inconvenient.
2
votes
James Menzies
shared this idea
Support for DATE_BUCKET shipped in SQL Prompt 10.13.9 https://documentation.red-gate.com/sp/release-notes-and-other-versions/sql-prompt-10-13-release-notes