Jes Sie

Jes Sie

  • 700
  • 1.2k
  • 264.9k

Retrieve Previous Years Data From SQL Server

Nov 13 2019 9:25 PM
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)