larrydavid
Programmer
Hello,
In SQL Server 2005 I am trying to select a date 18 months before the current date:
I really tried to figure this one out on my own. I think I'm pretty close, but I keep getting: "Invalid parameter 1 specified for dateadd."
Can someone please show me where I'm going wrong?
Thanks,
Larry
In SQL Server 2005 I am trying to select a date 18 months before the current date:
Code:
select * from dbo.TEST
where DATEADD(datepart(month,TESTDATE), -18, getdate())
I really tried to figure this one out on my own. I think I'm pretty close, but I keep getting: "Invalid parameter 1 specified for dateadd."
Can someone please show me where I'm going wrong?
Thanks,
Larry