# Re: 请有心人救救我,怎样储存空的日期去Database,而Database不会转变成1899/12/30

Posted by Fai on September 02, 1999 at 17:47:39:

In Reply to: Re: 请问怎样储存空的日期去Database,而Database不会转变成1899/12/30 posted by nothing on September 02, 1999 at 16:24:07:

: : 我要将空的日期储存到Database内的ExpiryDate,但发觉就算Save其他Field,而不Save ExpiryDate,DataBase Record的ExpiryDate
: : 会自动变成1899/12/30,总之我想要令到储存的时候,ExpiryDate是要空的,请问要怎么做?谢谢!

:
: 日期型态的栏位设定可以存null
: 资料写入时判资料如果是空的要写入字串 "null"
: 试试看..

: SQLTempVariableString = "insert AcVoucherHead values ( '" & Text1.Text & "'," & _
: "'" & Left(Combo1(1).Text, 1) & "'," & _
: Chr(40) & "Null" & Chr(41) & "," & _
: Chr(40) & "Null" & Chr(41) & "," & _
: "'" & Left(Combo1(2).Text, 1) & "'," & _
: "'01'," & _
: "'传票输入'," & _
: "''," & _
: "'" & Date & "'," & _
: "'" & PUserNo & "' )"

首先谢谢您,无论我用Null,vbNull 或 不Save 这个ExpiryDate Field,
但是仍然Save 1899/12/30,请有心人救救我!!!

Follow Ups:

- Try... wei 00:15:54 9/03/99 (1)
  - Re: Thank you very much! Fai 12:10:35 9/06/99 (0)