Re: [問題] ASP 3.0 取出當日的資料可以這樣寫嗎
※ 引述《molucolin (molucolin)》之銘言:
: if Session("Date")=Empty then
: Session("Date")=Date
: end if
: TodayDate=Session("Date")
: sql="Select * from DataBase where DBDate = TodayDate"
: ^^^^^^^^^^^
: 要怎麼改才可以幫當日的資料秀出
: DBDate 是資料庫的一個日期欄位
試試這招, 偷吃步法:p
sql = "Select * from DateBase where " & _
"DateDiff(d,DBDate,getdate()) = 0"
不過前提是... 你的資料庫要是MS SQL 的..
(Access的我就不曉得行不行得通了)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.229.61.172
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
Web_Design 近期熱門文章
PTT數位生活區 即時熱門文章