Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    19

    Unanswered: Update - Syntax error in date in query expression '##'. - REvisited

    ok So the previous thread
    http://www.dbforums.com/showthread.php?postid=3631601 was very helpful but I knew there would be a problem down the road.. and now I'm down the road.

    How do I update:

    Code:
    Update = "UPDATE permtracker SET Address = '"& Address &"', plan = '"& plan &"', Community = '"& Community &"', IntranetPost_date = #"& IntranetPost_date &"#, submit_date = #"& submit_date &"#, Acct_pu_date = #"& Acct_pu_date &"#, Est_pu_date = #"& Est_pu_date &"#, Issue_date = #"& Issue_date &"# WHERE ID="& ID &""
    If I use the code from the previous thread and I'm trying to update by clearing out a value then it doens't update the new null value.

    So the question is how to clear a date field with an update with out getting and Error. Its stumped me all day, then again I've been up for 36 hours..

    Thanks for All the help
    -josh

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    from the previous thread...

    <%
    Dim SQL1, SQL2, SQL
    SQL1 = "INSERT INTO Permtracker (Address, plan, Community"
    SQL2 = "Values('" & Address & "', '" & plan & "', '" & Community & "'"

    If Not IsEmpty(IntranetPost_date) AND Trim(IntranetPost_date) <> "" Then
    SQL1 = SQL1 & ", IntranetPost_date"
    SQL2 = SQL2 & ", #" & IntranetPost_date & "#"
    Else
    SQL1 = SQL1 & ", IntranetPost_date"
    SQL2 = SQL2 & ", null"
    End If

    .... etc ....

    If Not IsEmpty(Issue_date) AND Trim(Issue_date) <> "" Then
    SQL1 = SQL1 & ", Issue_date"
    SQL2 = SQL2 & ", #" & Issue_date & "#"
    Else
    SQL1 = SQL1 & ", Issue_date"
    SQL2 = SQL2 & ", null"
    End If

    SQL = SQL1 & SQL2 & ")"
    %>

Posting Permissions

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