bustercoder
Programmer
- Mar 13, 2007
- 96
Hello, I have this function I use to grab dates for the current year-to-date (From 1/1/2007 to current day):
RMTrxTemp.DOCDATE >= DATEADD(YEAR, DATEDIFF(YEAR,0,GETDATE()),0) AND DOCDATE < DATEADD(DAY, DATEDIFF(DAY,0,GETDATE()),0)
I'm having some trouble trying to figure out how to do exactly this but for the previous year. Could someone please show me? I thought it would be easy but...
Thanks,
Buster
RMTrxTemp.DOCDATE >= DATEADD(YEAR, DATEDIFF(YEAR,0,GETDATE()),0) AND DOCDATE < DATEADD(DAY, DATEDIFF(DAY,0,GETDATE()),0)
I'm having some trouble trying to figure out how to do exactly this but for the previous year. Could someone please show me? I thought it would be easy but...
Thanks,
Buster