作者jimshih (果汁)
看板Web_Design
标题Re: [问题] ASP语法问题...
时间Wed Feb 15 09:19:23 2006
※ 引述《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