1
Answer

Retrieve Previous Years Data From SQL Server

Jes Sie

Jes Sie

5y
443
1
I need an assistance again. Below is a snippet where I get a record from year to date:
  1. WHERE (DateIssued between    
  2.          DATEADD(YEAR, DATEDIFF(YEAR, 0, GETDATE()), 0) and  
  3.          DATEADD(MILLISECOND, -3, DATEADD(YEAR, DATEDIFF(YEAR, 0, GETDATE()) + 1, 0)))  
What I need now is to get the record from previous year of the same date. 
 
Thank you in advance. 
Answers (1)