babelfish_extensions icon indicating copy to clipboard operation
babelfish_extensions copied to clipboard

DATEDIFF() T-SQL function does not recognize 'weekday' and 'dw' units

Open robverschoor opened this issue 1 year ago • 0 comments

In Babelfish, the DATEDIFF() BIF does not recognize the 'weekday' and 'dw' units. All of the below examples are valid in SQL Server. NB. 'weekday' seems to be undocumented: https://github.com/MicrosoftDocs/sql-docs/blob/live/docs/t-sql/functions/datediff-transact-sql.md.

1> select datediff(weekday, getdate(), getdate())
2> go
Msg 16801924, Level 16, State 1, Server BABELFISH, Line 1
syntax error at or near "weekday"

1> select datediff(dw, getdate(), getdate())
3> go
Msg 16801924, Level 16, State 1, Server BABELFISH, Line 1
syntax error at or near "dw"

robverschoor avatar Dec 09 '23 10:12 robverschoor