View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Null date in VBA variable

Hi Dennis

As soon as you define a variable as a date, it gets the default value zero.
Null is "unknown", while zero is day zero. VBA doesn't really operate with
Null in the database sense of the word.

I'm not sure how/if you can set a database field to be Null either. What's
this for ?

HTH. Best wishes Harald

"Den" skrev i melding
...
Given a VBA variable of type date, how can you set the variable to a null
value.

I tried mydate = Null. But VBA does not like that.

Is there someway to set it to null. It is a variable that will be passed
to an SQL database.

Thanks
Dennis