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 |
|
jept
Starting Member
14 Posts |
Posted - 2007-04-16 : 13:02:46
|
| Hello,I have a table with a field Expiration of smalldatetime. I want to only display the data that has 60 days or more between Expiration and todays date. Any help would be highly appreciated. |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-04-16 : 13:05:29
|
| select * from MyTablewhere Expiration > getdate()-60_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-04-16 : 13:05:48
|
| select *from table1where expiration < dateadd(day, -60, current_timestamp)Peter LarssonHelsingborg, Sweden |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-16 : 13:06:11
|
[code]select *from tablewhere expiration >= dateadd(day, +60, getdate())[/code] KH |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-16 : 13:08:29
|
quote: Any help would be highly appreciated.
Too much help ? Are you looking for future expiration of expired date ? KH |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-04-16 : 13:09:19
|
| LOL!_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
|
|
|