Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2006
    Posts
    157

    Unanswered: Having Problems Passing a date value through SQL command

    I'm trying to insert / append a new record, and one of the fields in the table is a date value,

    I'm using sql insert statement, and the date that the table receives is
    30-Dec-1899...

    I've checked my date variable before and after the insert statement
    and it is consistent with the current date... which I retrieve via date()

    since the table field has format medium date. I also tried
    format (datevar, "medium date") which results in access looking for a parameter value.


    also tried format (datevar,"short date") .. not successful

    what is wrong with using sql to insert new record, all other fields were added
    smoothly except for this...

    appreciate any help...
    Only quitters quit!

  2. #2
    Join Date
    Apr 2006
    Posts
    157
    In case it might help anyone,

    the sql statement should have passed date as

    var,'" & format(date(),"yyyy-mm-dd") & "',nextvar
    Only quitters quit!

  3. #3
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The value needs to be surrounded by # instead of '.
    Paul

Posting Permissions

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