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 |
yardy78
Starting Member
3 Posts |
Posted - 2014-10-30 : 22:28:06
|
date function that gets the max date of a field named created date plus 8 years ERRORexample select firname, lastname, count(accountid), max(created_date)from employesswhere created_date > dateadd(year,8,created_date)group by firname, lasstname,having count > 1 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-10-31 : 00:00:49
|
[code]select firname, lastname, count(accountid), DATEADD(YEAR, 8, max(created_date))from employesswhere created_date > dateadd(year,8,created_date)group by firname, lasstname,having count(accountid) > 1[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
|
|
|
|
|