好吧,所以我的代码工作正常,但我需要它添加一天到OrderDate,同时保持它在相同的格式yyyy-mm-dd
任何帮助极大赞赏!我需要添加一天到我的日期在我的代码,试过DateAdd
<%
inDate = oRS("ordDate")
' get each date component
thisMonth = datepart("M",inDate)
thisDay = datepart("D",inDate)
thisYear = datepart("yyyy",inDate)
' check for the length of the month and day components
if len(thisMonth) < 2 then thisMonth = "0" & thisMonth
if len(thisDay) < 2 then thisDay = "0" & thisDay
' Create the date in your format you posted above
OrderDate = thisYear & "-" & thisMonth & "-" & thisDay
%>
我回来删除的问题,我可以只使用:\t \t THISDAY =日期部分(“d”,使用DateAdd(“d”,1,铟酸)) – BWalt302
,将工作,但您可能希望保留记录的原始日期。特别是如果你处理金钱交易。 –
此代码的目的只是为了生成预计发货日期,这是大多数情况下总是在订单后1天,有时是同一天。但是原始日期仍然可以在订单表中找到。谢谢您的帮助!我继续选择你的答案作为答案。 – BWalt302