Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Qadriyah Malik   on Feb 28 In MS Office Category.

  
Question Answered By: Alyssa Kelley   on Feb 28

In the line...
> Dim Dt, Dt2 As Date

... Dt and Dt2 are *not* both dates. Dt will be a variant type and Dt2
will be a specific date  type. You have to specify a
type for *each* item seperated by a comma or it defaults.

That's one of the reasons that a lot of programmers write each
definition on a different line... to be sure and clear about what's
what.

Dim Dt as Date, Dt2 as Date
... is the same as ...
Dim Dt as date
Dim Dt2 as date

Dim Dt, Dt2 as Date
... is the same as
Dim Dt as Variant
Dim Dt2 as date

Share: 

 
 
Didn't find what you were looking for? Find more on The amazing and convoluted date formats Or get search suggestion and latest updates.


Tagged: