SQL DATE TIME
1. What will be the output of following ?
select CAST (0 as datetime)
'1900-01-01 00:00:00.000'
returns epoch
2. How to create a date from given integers for year , month,date
Declare @DayOfMonth TinyInt
Set @DayOfMonth = 20
Declare @Month TinyInt
Set @Month = 6
Declare @Year Integer
Set @Year = 2006
Select DateAdd(day, @DayOfMonth - 1,DateAdd(month, @Month - 1,DateAdd(Year, @Year-1900, 0)))
3. How to get first date of current month ?
select convert(datetime ,
cast(DATEPART(year , getdate()) as nvarchar(10)) + '-' +
cast (DATEPART(month , getdate()) as nvarchar(5)) +
'-01'
)
Subscribe to:
Post Comments (Atom)
DOCKER ARG instruction as opposed to ENV instruction
In Docker, ARG and ENV are used to define environment variables. The ARG instruction defines variables that users can pass to the builder ...
-
http://www.sommarskog.se/share_data.html How to Share Data Between Stored Procedures An SQL text by Erland Sommarskog, SQL Server MVP. M...
-
CONCLUSION : 1. Normally, use following two when you do not want query compilation also to come into picture. CHECKPOINT DBCC DROPCLEA...
-
Most of the google tutorials on keras do not show how to display a confusion matrix for the solution. A confusion matrix can throw a clear l...
No comments:
Post a Comment