mysql - if condition inside Insert query in excel? -


i'm trying turn records in excel insert query. i've fields empty in situations. in such case, null should inserted. i've written formula below not working/showing error. think i've missed something.

="insert table_1 values(" &a2 &",'" & b2 & "','"&c2&"','"&d2&"',"&e2&","&f2&", if((isblank(g2)), "null", '" & g2 & "'),'" & h2 & "','" & i2 & "');"

in ablove formula, i'm checking g2 cell empty or not.
correct way else someother way there?

i not try , amalgamate in standard cell in way - tends cause confusion (as have found)

with in mind, below appears want:

="insert table_1 values("&a2&",'"&b2&"','"&c2&"','"&d2&"',"&e2&","&f2&", "&if(isblank(g2),"null","'"&g2&"'")&",'"&h2&"','"&i2&"');" 

you had brackets , quotes appears required.

i try chaining between cells ( write sql queries in vba , build them line line)

i hope helps


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -