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 |
Dan1980
Starting Member
9 Posts |
Posted - 2013-11-01 : 08:08:51
|
HelloHoping someone can help.I'm currently using the SQL to find records older than todays date in the SSD_SED field. I'm having to update the date manually each day. Is there a way I can automate this?AND (SSD_SED < '2013-11-01')order by SSD_SED DESCRegardsDan |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2013-11-01 : 08:14:34
|
AND (SSD_SED < dateadd(day,datediff(day,0,getdate()),0))order by SSD_SED DESCMadhivananFailing to plan is Planning to fail |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2013-11-01 : 08:14:56
|
[code]select getdate()orselect dateadd(day, datediff(day, 0, getdate()), 0)[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
Dan1980
Starting Member
9 Posts |
Posted - 2013-11-01 : 09:23:26
|
Thanks guys. Works great. |
 |
|
|
|
|