Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another question about empty strings??? dates this time

Status
Not open for further replies.

crashc123

Technical User
Oct 3, 2001
80
US
First thanks to all for all the help you guys have given. Truly a lifesaver!!!

Okay now for the final...(I hope question)...

how to allow empty strings in date fields? the table can have blank dates but when I leave a field blank on form i get this error

Microsoft JET Database Engine error '80040e07'
Syntax error in date in query expression '##'.
/myweb/Projectlist_copy(11-16-01)(2).asp, line 273

here's the code it refers to:

strSQL = "UPDATE Projects SET " _
& "JobNo='"&Request.Form("JobNo")&"',"_
& "Title='"&Request.Form("Title")&"',"_
& "Description='"&Request.Form("Description")&"',"_
& "Aircraft='"&Request.Form("Aircraft")&"',"_
& "JobType='"&Request.Form("JobType")&"',"_
& "Engineer='"&Request.Form("Engineer")&"',"_
& "Focal='"&Request.Form("Focal")&"',"_
& "DER='"&Request.Form("DER")&"',"_
& "DateIn=#"& Request.Form("DateIn")&"#,"_ 'here I think is the problem and lines below
& "DateDue=#"& Request.Form("DateDue")&"#,"_
& "8110Due=#"& Request.Form("8110Due")&"#,"_
& "DTRDue=#"& Request.Form("DTRDue")&"#"_
& "WHERE (ID="& iRecordId &")"


Set cnnDBEdit = Server.CreateObject("ADODB.Connection")
cnnDBEdit.Open CONN_STRING

cnnDBEdit.Execute strSQL, adAffectAll, adCmdText or adExecuteNoRecords


/////////////////////////////////////
here is the lines from the request form:

<tr>
<td>Date In</td>
<td><input type=&quot;text&quot; name=&quot;DateIn&quot; Value=&quot;<%=(rstDBEdit.Fields(&quot;DateIn&quot;).Value) %>&quot; ><i>mm/dd/yy</i></td>
</tr>
<tr>
<td>Date Due</td>
<td><input type=&quot;text&quot; name=&quot;DateDue&quot; Value=&quot;<%= (rstDBEdit.Fields(&quot;DateDue&quot;).Value) %>&quot; ><i>mm/dd/yy</i></td>
</tr>
<tr>
<td>8110 Due</td>
<td><input type=&quot;text&quot; name=&quot;8110Due&quot; Value=&quot;<%= (rstDBEdit.Fields(&quot;8110Due&quot;).Value) %>&quot; ><i>mm/dd/yy</i></td>
<tr>
<tr>
<td>DTR Due</td>
<td><input type=&quot;text&quot; name=&quot;DTRDue&quot; Value=&quot;<%= (rstDBEdit.Fields(&quot;DTRDue&quot;).Value) %>&quot; ><i>mm/dd/yy</i></td>
</tr>

 
Now I am back to this one( was ignoring it hoping it would mysteriously disappear)

Where would I put this statement? before the update sql? in the request form ? in the sql update statement?

Again Thanks for all your help

Sonya
:)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top