空日期值 [英] Null date value

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

问题描述

如果我需要为日期变量分配一个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.

推荐答案

" Brad" ; <峰; br ** @ discussions.microsoft.com> schrieb
"Brad" <Br**@discussions.microsoft.com> schrieb
如果我需要为日期变量分配一个NULL值,我该如何去做呢?目前我正在使用01-01-2001,但是我不想使用真实的如果日期真的应该为NULL,则为date。

感谢您的信息。
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


" Brad" <峰; br ** @ discussions.microsoft.com> schrieb:
"Brad" <Br**@discussions.microsoft.com> schrieb:
如果我需要为日期变量分配NULL值,我该如何去做呢?目前我正在使用01-01-2001,但我不想使用
一个真实的日期,如果日期确实应为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.




请参阅:


< 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/>


Brad写道:
如果我需要为日期变量分配一个NULL值,我该如何去做呢? ?目前我正在使用01-01-2001,但是我不想使用真实的date如果日期真的应该为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.




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


-


(O)enone



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

--

(O) e n o n e


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆