Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2015-03-11 : 06:33:12
|
hello,I would ike to get this query to work:select...from...where...and datediff(m, MyDate, convert(date, '31 Dec ' + dateadd(yy, -1, YEAR(tbl1.Date)))) >=12note that tbl1.Date has a value of '03/07/2015'I basically am trying to make sure the returned data is 12 month or more.Any suggestions please?Thanks |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2015-03-11 : 07:36:19
|
Is this?Where date>=dateadd(month,-12,getdate())MadhivananFailing to plan is Planning to fail |
|
|
sunder.bugatha
Yak Posting Veteran
66 Posts |
Posted - 2015-03-11 : 10:00:13
|
It should be something like below :convert(date,'31 Dec' + convert(varchar(10),year(DATEADD(y,-1,tbl1.Date))))Hema Sunder |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|