The Date Conundrum

Results 1 to 2 of 2

Thread: The Date Conundrum

  1. #1
    ricmac Guest

    Default The Date Conundrum

    Well this is officially driving me nuts. How to insert the current date/time into an Access database?<BR><BR>David, unfortunately the #" & Date() & "# solution didn&#039t work. I tried this with Access formatted to receive date/time and also as just text. But no joy :-(<BR><BR>Does anyone out there want to give it one last shot? &#060;he says, almost begging...&#062;<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default No conundrum...

    ...if all you want is the current date and time, then do it all in SQL and bypass the VBScript stuff, entirely:<BR><BR><BR>&#060;%<BR>SQL = "INSERT INTO table ( fld1, fld2, whenAdded, fld3 ) " _<BR>&nbsp; &nbsp; &nbsp; &nbsp; & "VALUES(&#039" & value1 & "&#039,&#039" & value2 & "&#039,Date(),&#039" & value3 & "&#039)"<BR>...<BR>%&#062;<BR><BR>see it? Date is a function in SQL (well, Access&#039s version of is GetDate() in TSQL, etc.) just as much as it is in VBScript, so why not let Access get the date itself and not get VBS involved at all?<BR><BR>

Posting Permissions

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