For whatever reason, I’m getting the error “Invalid column name allocationStart” when trying to execute a query. This is within the dateadd function, and the column DOES exist in the database. it is a datetime.
Here is the query:
cmd.commandText = "Insert Into EmpPac
(catalogIdent, empPacIdent, empIdent, allocation,
quantityLimit, quantityIssued, quantityShipped,
allocationMonths, sizeChartIdent, sizeNotes, nextUpdate)
values ( '" & catalogIdent & "', '" & intvalue_EmpPak
& "', '" & empIdent & "',"&jobQuantityLimit&",'"
&jobQuantityLimit&"', '0', '0',"&
allocationMonths&", '"& sizeChartident &
"', '', DATEADD(month, "&allocationMonths&
", allocationStart))"
cmd.execute
You don’t specify what table
allocationstartis in.You need to make your
INSERTsource be aSELECTfrom your source table, not using theVALUESkeyword since that expects a list of explicit values.For instance: