返回資料是這樣的:
1 : sunday
2 : monday
3 : tuesday
4 : wednesday
5 : thursday
6 : friday
7 : saturday
SELECT DATEPART(DW,GETDATE())
GO
參考來源:
How to check if datetime happens to be Saturday or Sunday in SQL Server 2008
Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share…stackoverflow.comDATEPART (Transact-SQL) - SQL Server
Applies to: SQL Server (all supported versions) Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics…docs.microsoft.comhttps://stackoverflow.com/questions/1110998/get-day-of-week-in-sql-server-2005-2008
Grafana + Telegraf + InfluxDB 監控 SQL Server - SQL Server
Task Scheduler設定排程錯誤時發送Mail - Powershell
JOIN ON 常數的用途是什麼?跟放在WHERE一樣嗎?/ FULL JOIN要注意的事項- SQL Server
SEO(1) Github(2) Title Tag(2) ML(1) 李宏毅(1) SQL Server(18) Tempdb(1) SSMS(1) Windows(1) 自我成長(2) Excel(1) python Flask(1) python(5) Flask(2)
bart30508 (147)