Visual Basic Variable DIM as Date

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I need to reset a Date Variable to NUll or no date.

Dim Nodate as Date

NoDate = ""

This code errors and I need to set the variable to null so
I can set a field in a table to nodate.

Any Ideas?

Thanks is advance
 
Chris said:
I need to reset a Date Variable to NUll or no date.

Dim Nodate as Date

NoDate = ""

This code errors and I need to set the variable to null so
I can set a field in a table to nodate.

Only a variable of type Variant can contain a Null value.
 
A Date is actually, behind the scenes, stored as a double precision floating
point, with the integer part representing days since Dec. 30, 1899 and the
fractional part representing time, so even a date value of 0 represents a
date... 12:00 AM Dec. 30, 1899. If your actual date range is appropriate,
that could represent "no date" for you.

Oh, yes, lest someone ask... the "days since" portion can be negative to
represent time and date prior to Dec. 30, 1899. As to why they chose _that_
particular date as the zero point, you'd have to ask someone in Redmond, WA,
USA, not me.

Larry Linson
Microsoft Access MVP
 
Back
Top