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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inner Join Update Statement

Status
Not open for further replies.

aumstu

MIS
Jan 20, 2006
40
US
I am trying to update the WO_Dates table with a date that is provided by a textbox named freezedate. Below is the code

Code:
strSQL = "Update WorkOrder INNER JOIN WO_Dates ON WorkOrder.WorkOrder_ID = WO_Dates.WorkOrder_ID SET WO_Dates.WO_AlertDate=" & freezeDate & " WHERE WorkOrder.Pertaining =" & "Before Freeze" &""

Here is the error message:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression

Does anyone have any suggestions? The update statement will work if I just use a Date and do not use the Inner Join...so my guess, is that I dont have the Inner Join set up correctly.

Thanks for any help
 
try this:

strSQL = "Update WorkOrder INNER JOIN WO_Dates ON WorkOrder.WorkOrder_ID = WO_Dates.WorkOrder_ID SET WO_Dates.WO_AlertDate=" & freezeDate & " WHERE WorkOrder.Pertaining ='Before Freeze'

i am assuming that 'Before Freeze' is the hardcoded value...

-DNG
 
Thanks DotNet....I actually had typed in the column name wrong...but I did have to add #s for the date

Code:
adonCon.Execute = "Update WorkOrder INNER JOIN WO_Dates ON WorkOrder.WorkOrder_ID = WO_Dates.WorkOrder_ID SET WO_Dates.WO_Alert_Date=#" & freezeDate & "# WHERE WorkOrder.Pertaining = 'Before Freeze'"

Thanks again
 
no problem...i wasnt sure what database you were using...anyways, glad you got it working...

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top