Follow up: Re: [AccessD] force Null date/time data type value

Susan Harkins ssharkins at bellsouth.net
Fri Oct 3 09:55:37 CDT 2003


Thanks -- forcing the Null did work after all. I guess when I was working on it last night I just didn't follow through long enough. I tried a Date and a String variable and neither seemed to work. This morning I changed the variable to a Variant and set it to "Null" -- and it's working now. Thanks so much.

Susan H. 


  I tried inserting Null and it didn't seem to work -- but let me try again! ;) I want to avoid changing the actual structure, because some records will have a date, some won't -- but that is an option I've considered, but am hoping to avoid if possible. Thanks!

  Susan H. 

   
    Susan,

        Let the table T_Books consist of fields Author(text), Title(text) and RefDate(date type). Both the following statements will append a record having Null value in the date field -

        (a) If default value of RefDate is not Null -
            DoCmd.RunSQL "INSERT INTO  T_Books " & _
                    "(Author, Title, RefDate)  " & _
                    "Values('AAA',  'TTT' , Null) ;"

        (b) If default value of RefDate is already set as Null -    
            DoCmd.RunSQL "INSERT INTO  T_Books " & _
                "(Author, Title)  " & _
                "Values('AAA',  'TTT') ;"

    Regards,
    A.D.Tejpal
    --------------
      ----- Original Message ----- 
      From: Susan Harkins 
      To: AccessD at databaseadvisors.com 
      Sent: Friday, October 03, 2003 06:16
      Subject: [AccessD] force Null date/time data type value


      I'm using INSERT INTO to append records. When a text string isn't
      appropriate, I can use a zero-length string, but not the dates -- I've found
      no way to force a Null value using INSERT INTO. Any help?

      Susan H.



----------------------------------------------------------------------------


    _______________________________________________
    AccessD mailing list
    AccessD at databaseadvisors.com
    http://databaseadvisors.com/mailman/listinfo/accessd
    Website: http://www.databaseadvisors.com



------------------------------------------------------------------------------


  _______________________________________________
  AccessD mailing list
  AccessD at databaseadvisors.com
  http://databaseadvisors.com/mailman/listinfo/accessd
  Website: http://www.databaseadvisors.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20031003/b19c2d9f/attachment-0001.html>


More information about the AccessD mailing list