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)
How to check local and global angular versions
Use the command ng version (or ng v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to f...
-
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...
-
This error means you have created the DbContext but not configured/added it to the project using either DI in startup.cs or by using DbCon...
-
CONCLUSION : 1. Normally, use following two when you do not want query compilation also to come into picture. CHECKPOINT DBCC DROPCLEA...
No comments:
Post a Comment