學(xué)習(xí)探討開源和web開發(fā)
select * from t where 日期字段名字>DATEADD ( mm, -3, getdate())
//t 是你的表名
?
現(xiàn)在程序里得到當(dāng)前時間和3個月前的時間Date nowDate=new Date();Date oldDate=new Date();oldDate.setMonth(oldDate.getMonth()-3);
select * from tab where 日期字段>oldDate and 日期字段<newDate
posted on 2006-09-13 20:24 ericli 閱讀(1940) 評論(0) 編輯 收藏 所屬分類: SQL
Powered by: BlogJava Copyright © ericli