本文介绍了空日期值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我需要为日期变量分配一个NULL值,我该怎么办呢?
这样做?现在我正在使用01-01-2001,但我不想使用

areal日期,如果日期真的应该是NULL。


感谢您提供的信息。

If I need to assign a NULL value to a date variable, how would I go about
doing that? For right now I am using 01-01-2001, however I don''t want to use
a "real" date if the date should really be NULL.

Thanks for the information.

推荐答案



将其声明为Object或使用''WrappedDate''并指定Nothing代表

Null。


Class WrappedDate

public value as date

public sub New(value作为日期)

me.value = value

end sub

end class

Armin


Declare it as Object or use a ''WrappedDate'' and assign Nothing to represent
Null.

Class WrappedDate
public Value as date
public sub New(value as date)
me.value =value
end sub
end class
Armin





请参阅:


< URL:http://www.google .to / groups?threadm =%23wkAjb1mDHA.2080%40TK2MSFTNGP10.p hx.gbl>


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http://classicvb.org/petition/>



See:

<URL:http://www.google.to/groups?threadm=%23wkAjb1mDHA.2080%40TK2MSFTNGP10.p hx.gbl>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>





我使用Date.MinValue来表示null日期。这很好用。


-


(O)enone



I use Date.MinValue to represent a "null" date. This works very nicely.

--

(O) e n o n e


这篇关于空日期值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 16:32