# 很抱歉，你犯了3个错误

Posted by 四眼蟾蜍 on November 05, 1998 at 10:41:57:

In Reply to: 试了无效 ,不是应该用DateAdd吗? posted by 小Sam on October 28, 1998 at 13:17:51:

: 可是我试了这样不行耶....?
: Dim a, b As Date
**第一个错误 a被设成了Variant
**第二个错误 b设integer就好了，为什么要设Date
**应该设为 Dim a as Date,b as Integer

: a = 19980101
**第三个错误，要直接设Date有2种方式
**1. a= #1998/01/01#
**2. a= CTOD("1998/01/01")
**

: b = 32
: Text1.Text = a + b
: 不是应该用
: DateAdd函数吗?
** You got it!!

Follow Ups: