Find rows with last date of month


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. SELECT orderid, orderdate, custid, empid
  2. FROM Sales.Orders
  3. WHERE orderdate = DATEADD(MONTH, DATEDIFF(MONTH, '19991231', orderdate), '19991231');

Report this snippet


Comments


You need to login to view comments.