Syntax Error (missing operator) (1 Viewer)

Isaac

Lifelong Learner
Local time
Today, 08:26
Joined
Mar 14, 2017
Messages
8,774
Can anyone spot where my "syntax error" is? Only gets raised when I try to Run the query, not when I tab out of the column field

Code:
HasViewed_COBO: IIf(InStr(1,[View History],[COBOx])>0,"Yes","No")

In this case [View History] is another column (to the left) in the query. so is COBOx
 

plog

Banishment Pending
Local time
Today, 10:26
Joined
May 11, 2011
Messages
11,638
Are you sure its that part? Can you post the full SQL?

Also, remove the iif and see if its the Instr doing it:

HasViewed_CBO: InStr(1,[View History],[COBOx])
 

Isaac

Lifelong Learner
Local time
Today, 08:26
Joined
Mar 14, 2017
Messages
8,774
Ok .. I knew it! This was a red herring error - didn't really mean what it said I don't think.

Both COBOx and View history were vba-function-sourced columns....and somehow that was just too much for Access, I think.

I re-did it by saving that query (without the offending column), and nesting the query in a new outer query, and it works fine. Problem solved....sort of :)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:26
Joined
Oct 29, 2018
Messages
21,456
Try using the Nz() function, just in case of null values.

Edit: Oops, too slow...
 

Users who are viewing this thread

Top Bottom