Find rows with last date of month

Submitted by:Jhon Jhon

Date added:13 November, 2011

Category:SQL

How to find records with last date of month

Tags: sql date function

Code Snippet:

SELECT orderid, orderdate, custid, empid
FROM Sales.Orders
WHERE orderdate = DATEADD(month, DATEDIFF(month, '19991231', orderdate), '19991231');
 
 

Comments