Marcster
11-04-2016, 06:36 AM
I'm trying to get a sql statement:
UPDATE tblName SET Table1.[Month] = MonthName([Trans Date],True);
converted to a string so I can pass the Table Name and Field Name (which is a Date field) to it which will update the Month field.
So far i have:
strSQL = "UPDATE " & strTableName & " SET Month = " & CStr(MonthName(Month(strFieldName))) & ";"
Which errors with: Run-time error '13' Type mismatch.
CurrentDb.Execute strSQL
Thanks,
UPDATE tblName SET Table1.[Month] = MonthName([Trans Date],True);
converted to a string so I can pass the Table Name and Field Name (which is a Date field) to it which will update the Month field.
So far i have:
strSQL = "UPDATE " & strTableName & " SET Month = " & CStr(MonthName(Month(strFieldName))) & ";"
Which errors with: Run-time error '13' Type mismatch.
CurrentDb.Execute strSQL
Thanks,