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 |
Blessed1978
Yak Posting Veteran
97 Posts |
Posted - 2014-11-03 : 16:05:23
|
Get max date of a column that is greater than 3 years |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-11-03 : 16:10:19
|
select max(datecol) from yourtable where datecol > dateadd(yy,-3,getdate())Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
Blessed1978
Yak Posting Veteran
97 Posts |
Posted - 2014-11-04 : 10:16:24
|
I want to find the max date then show all transaction that have a date that is 3 years greater the max date. Not getdate()ExampleSelect distinct employee Id,count email, max transdate From employeeWhere transdate > dateadd year ,3, transdateGroup byHaving count |
|
|
|
|
|