Inserting Date and Time into Access db

Results 1 to 3 of 3

Thread: Inserting Date and Time into Access db

  1. #1
    ricmac Guest

    Default Inserting Date and Time into Access db

    Hi, Can someone please help? I&#039m trying to use the following code to insert the current date and time into an Access db:<BR><BR>strTime = formatDateTIME( TIME(), vbShortTime )<BR>strDate = formatDateTIME( DATE(), vbShortDate )<BR>...<BR>theSQL = "insert into XForm"<BR>...<BR>theSQL = theSQL & "values (&#039"&strXFormValue&"&#039, strTime&"&#039, &#039"&strDate&"&#039)"<BR><BR>I&#039ve cut and pasted the relevant bits. The error I get is:<BR><BR>Syntax error in INSERT INTO statement<BR><BR>It&#039s for a web form that users complete, but I want to note down the date and time they submitted the form. I&#039ve formatted Access to accept short time and date. Any advice appreciated.<BR><BR>Thanks, ricmac :-)<BR><BR>

  2. #2
    MG Guest

    Default to the rescue

    Take a look at for this answer. Look up inserting dates into Access.

  3. #3
    ricmac Guest

    Default RE: to the rescue

    Hiya,<BR><BR>Unfortunatelty I couldn&#039t find the answer at I searched on "access" and "date" plus other searches. Also searched past messageboard answers, but nada. Would make a great addition to the faqs though :-) Any ideas anyone?<BR><BR>Thanks heaps, ricmac

Posting Permissions

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