Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syntax error (Access 2000)

    I get Sytnatx error in string in query expression ""
    Where could my fault be ?

    Dim StrSQL As String
    StrSQL = "UPDATE Customers SET LastUpdated = "" "
    CurrentDb.Execute StrSQL

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Syntax error (Access 2000)

    To include quotes within a quotes string, you must double them. In your SQL string, you're setting LastUpdated to a double quote. That is not valid. You should use Null instead:

    StrSQL = "UPDATE Customers SET LastUpdated = Null"

    You must distinguish between the Value of a field and the DefaultValue. LastUpdated is a date/time field, so its Value must either be a valid date/time, or Null (i.e. empty, blank, missing). DefaultValue is always a string, regardless of the field type. In the above SQL string, you are setting the Value of the field, not the DefaultValue.

Posting Permissions

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