ixjngtv

  點部落 :: Home :: Syndication :: 我的收藏 ::  :: Login
  文章數 - 22, 回應數 - 4, 引用數 - 0

每月文章

參考

麻吉

string s =
             string.Format("Select * from *** where timestamp Between '{0}' and '{1}'", DateTime.Now.AddDays(-6).Date.ToString("yyyy/MM/dd"), DateTime.Now.Date.ToString("yyyy/MM/dd"));
             GridView1.DataSource = obj_DataBase.QueryDB(s, "").Tables[0];
             GridView1.DataBind();

posted on 2008/6/13 09:44 | 我要推薦 | 閱讀數 : 150 | 訂閱

關連文章


Feedback

# re: 顯示近七天資料 2008/6/13 上午 09:58 dotjum 回覆
也可以使用 DateDiff 的方式
SELECT   timestamp , DateDiff(day,timestamp,getdate())  FROM ***
WHERE DateDiff(day,timestamp,getdate()) < 7
ORDER BY timestamp DESC


 



回應

標題:
姓名:
電子郵件:(將不會被顯示)
個人網頁:
內容: 

登入後使用進階評論
Please add 4 and 5 and type the answer here: