Skip to navigation
Mssql get the beginning of this month with mssql and convert to 112 format
10.11.17
select CONVERT(VARCHAR(8),DATEADD(mm, DATEDIFF(mm, 0, GETDATE()), 0),112) as from_date
http://zarez.net/?p=2462
Reply
Anonymous
Convert from string back to a date object ```tsql SELECT DAY(EOMONTH(GETDATE())) DECLARE @year varchar SET @year = '2024' DECLARE @month varchar SET @month = '08' SELECT DAY(EOMONTH(convert(datetime, CONCAT(@year,@month,'01'), 112))) SELECT convert(datetime, '20240915', 112) ```
10.11.17
Reply
Anonymous
Information Epoch 1732354516
Use simple algorithms as well as simple data structures.
Home
Notebook
Contact us