Hello,
I have a VBA with an SQL statement. I need to ignore any values that are blank
Below is portion of VBA:
"SELECT * FROM Data.dbo.Contract_Summary_Workbook as w WHERE w.""ProjectNo"" " & _
"like '" & Lists.Range("C4").Value & "%' or w.""ProjectNo"" like '" & Lists.Range("C3").Value & "%' or w.""ProjectNo"" not like '" & Lists.Range("C9").Value & "%'" _
)
in C9 I have blank cell with no content, in C4 and C3 I have project numbers.
If there will be blank content in C3 the data still gives me all table dump (for all projects).
Is there a way for me to exclude any input variables that have blanks?
I don't really know if there's a way for me to loop through input values in SQL statement.
Thanks,
I have a VBA with an SQL statement. I need to ignore any values that are blank
Below is portion of VBA:
"SELECT * FROM Data.dbo.Contract_Summary_Workbook as w WHERE w.""ProjectNo"" " & _
"like '" & Lists.Range("C4").Value & "%' or w.""ProjectNo"" like '" & Lists.Range("C3").Value & "%' or w.""ProjectNo"" not like '" & Lists.Range("C9").Value & "%'" _
)
in C9 I have blank cell with no content, in C4 and C3 I have project numbers.
If there will be blank content in C3 the data still gives me all table dump (for all projects).
Is there a way for me to exclude any input variables that have blanks?
I don't really know if there's a way for me to loop through input values in SQL statement.
Thanks,