Find first and last day of current month in sql server



Find first and last day of current month in sql server..

Answer / Mohd Yameen

To find the first and last day of the current month in SQL Server, you can use EOMONTH function:nn```sqlnSELECT EOMONTH(GETDATE()) + 1 AS LastDayOfMonth,n EOMONTH(GETDATE()) + 1 - DATEPART(DAY, GETDATE()) AS FirstDayOfMonth;n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Can you explain what is the use of custom fields in report?

1 Answers  


How to reaname table name without using sp_Rename in sql server..?

1 Answers   Wipro,


What is your recommendation for a query running very slow? : sql server database administration

1 Answers  


How to drop an existing schema in ms sql server?

1 Answers  


Delete duplicate rows without using rowid.

1 Answers   Nagarro,


What do you mean by recursive stored procedure?

1 Answers  


What are the differences between left join and inner join in sql server?

1 Answers  


How to get the definition of a view out of the sql server?

1 Answers  


What is difference between process and thread? Explain lazy writer funcationality.

2 Answers   Microsoft,


What is the template in sql?

1 Answers  


What are clustered and non-clustered index?

1 Answers  


Can we create a clustered index on composite primary key.

3 Answers   IGT,


Categories