inserting dates

Results 1 to 2 of 2

Thread: inserting dates

  1. #1
    vanessa Guest

    Default inserting dates

    I tried to insert a record into the database with the FormatDateTime(Date(),1) syntax, unfortunately the date inserted was shown as 01/01/1900. I have used the formatdate... function before on another database and the insertion worked just fine. I would like to know if the date and time has to be set up on the database, if it does how do I do this <BR>thankyou

  2. #2
    Join Date
    Dec 1969

    Default RE: inserting dates

    The syntax for inserting dates is...<BR><BR>sql = "INSERT INTO MYTABLE (MYDATE) VALUES (#" & MYDATEVAL & "#)"<BR> (Access)<BR><BR>sql = "INSERT INTO MYTABLE (MYDATE) VALUES (&#039" & MYDATEVAL & "&#039)"<BR> (Other databases)<BR><BR>The MYDATE field has to be defined as DATETIME or DATE/TIME depending on what dbms you&#039re using.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts