I've tried several iterations of this SQL statement in a stand alone script:
QF5 = "Week"
QF6 = "Wk"
RV3 = ""
WC4 = """" {} <> {} AND {} <> '{}' """.format(QF5,QF6,QF6, RV3)
I'm aiming for an expression that would read int he field calculator:
Select From(*) Table Where:
Week <> Wk AND Wk <> ''
This is the error I'm getting:
ERROR 000358: Invalid expression
Failed to execute (SelectLayerByAttribute)
asked Oct 27, 2016 at 19:30
-
Your SQL is not correct: Select * From [Table] Where Week <> Wk AND Wk <> ''Brad– Brad2016年10月27日 19:47:03 +00:00Commented Oct 27, 2016 at 19:47
-
Right, sorry I was just guessing the first part of the query from the field calculator. That bit is not being expressed int the script.geoJshaun– geoJshaun2016年10月27日 20:30:24 +00:00Commented Oct 27, 2016 at 20:30
1 Answer 1
This should work: WC4 = """{0} <> {1} AND {1} <> ''""".format(QF5,QF6)
Your double quotes were unbalanced, and you don't need RV3
.
answered Oct 27, 2016 at 20:05
Explore related questions
See similar questions with these tags.
default