FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Add days to a date
Use DATEADD for date arithmetic.
DATEADD✓ Tested
Count day boundaries between dates
Compare date values with DATEDIFF.
DATEDIFF✓ Tested
Find the final day of a month
Use EOMONTH without manually calculating month length.
EOMONTH✓ Tested
Join rows in a chosen order
Aggregate text with STRING_AGG and WITHIN GROUP.
STRING_AGG✓ Tested
Split delimited text with positions
Retain original order with STRING_SPLIT ordinals.
STRING_SPLIT✓ Tested