Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am running a following simple query in my macro
SQL_String = "Update [TABLENAME] set Category = '" & psaCat.text & "',Category_No = '" & ruleNum.text & "' Where [Employee Name] Like '" & empName.text &"' AND [Expense Justification] LIKE '**';"
Here my column [Expense Justification] has few blank values.
The update statement works when Employee Name = 'abc' AND Expense Justification = 'Some text'
but it does not work when Employee Name = 'abc' AND Expense Justification = ' '
My assumption is, LIKE '**' takes into account any text value or blank value.
Am I missing something obvious here.
I tried isNull which does not work either.
Any pointers are appreciated.
Regards,
T
Hi, T,
Is Expense Justification = ' ' case a NULL value or empty value?
You can try
AND ([Expense Justification] LIKE '**' OR [Expense Justification] is NULL)
or
AND ([Expense Justification] LIKE '**' OR [Expense Justification]='')
Zhihong
Hi Zhinhong,
Thanks for looking into this.
Its a empty value.
I tried the expressions you mentioned but it does not work.
Regards,
T