If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Update - Syntax error in date in query expression '##'. - REvisited

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-01-04, 18:25
iamjosh iamjosh is offline
Registered User
 
Join Date: Feb 2004
Posts: 19
Update - Syntax error in date in query expression '##'. - REvisited

ok So the previous thread
http://www.dbforums.com/asp/985696-insert-into-syntax-error-date-query-expression.html#post3631601 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
Reply With Quote
  #2 (permalink)  
Old 03-01-04, 20:50
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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 & ")"
%>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On