Forum Discussion
t-zhanqi
6 years agoMicrosoft Employee
SQL statement syntax error when using DATEADD()
I want to get the Monday of the CreatedDTim. But i encountered an error while trying to connect.
- 6 years ago
HI, v-easonf-msft
Thank you for your help. Your reply is of great help to me in solving this problem. I have solved this problem by using TIMESTAMPADD(). The reason I can't use DATEADD() is that my data source is ODBC instead of SQL SERVER.
amitchandak
6 years agoSuper User
t-zhanqi , refer these for sql server date add
https://www.w3schools.com/sql/func_sqlserver_dateadd.asp
https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql?view=sql-server-ver15
I doubt it has anything to do with power BI. Incase this SQL is working on SSMS and not working here, then it needs to be checked.
t-zhanqi
6 years agoMicrosoft Employee
Thank you for your help. I have solved this problem by using TIMESTAMPADD(). The reason I can't use DATEADD() is that my data source is ODBC instead of SQL SERVER.