※ 引述《itistsg (小安)》之銘言:
: 請教一下...
: 程式碼如下:
: <%
: Dim WhereYear, WhereMonth
: WhereYear = 2003
: WhereMonth = 7
: dim GetDate
: GetDate = #&WhereYear&/&WhereMonth&/1#
: %>
: 我希望將 WhereYear 以及 WhereMonth的數值傳給 GetDate
: 可是不知道語法
: 有誰知道方法可以分享一下嗎??
我比較喜歡再設一個變數來放日期值啦~
Dim strDate
strDate = WhereYear & "/" & WhereMonth & "/1"
GetDate = DateValue(strDate)
不過如果日期格式不對的話 (比如說2003/2/30)
用DateValue轉會出錯喔~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.229.61.172