Invalid column name

livvie

Registered User.
Local time
Today, 08:37
Joined
May 7, 2004
Messages
158
I am trying to run the following code but I keep getting the error
'Invalid column name'

SQL1 = " Update SQLACCESS.tblctjor " & _
" Set systemtime = Now " & _
" WHERE systemloggoff = 1 AND start is not null "
DoCmd.RunSQL (SQL1)

I have also tried Now()
 
livvie,

The "invalid column name doesn't refer to the Now".

The syntax is "Update Table Set Field = ..."

Your table is SQLACCESS.tblctjor <-- Not a table name (what's tblctjor?)

Your field is systemtime <-- OK

Or, you may just need the # punctuation shown below.

But the SQLACCESS.tblctjor should be JUST your table name.

Code:
SQL1 = " Update SQLACCESS.tblctjor " & _
       " Set systemtime = #" & Now()  & "#" & _
       " WHERE systemloggoff = 1 AND start is not null "
DoCmd.RunSQL (SQL1)

Wayne
 
WayneRyan said:
livvie,

The "invalid column name doesn't refer to the Now".

The syntax is "Update Table Set Field = ..."

Your table is SQLACCESS.tblctjor <-- Not a table name (what's tblctjor?)

Your field is systemtime <-- OK

Or, you may just need the # punctuation shown below.

But the SQLACCESS.tblctjor should be JUST your table name.

Code:
SQL1 = " Update SQLACCESS.tblctjor " & _
       " Set systemtime = #" & Now()  & "#" & _
       " WHERE systemloggoff = 1 AND start is not null "
DoCmd.RunSQL (SQL1)

Wayne

tblctjor is the table name SQLACCESS is the owner of the table.
 

Users who are viewing this thread

Back
Top Bottom