problem in check the null condition in query

This is the code

SELECT query1.field1, query1.field2, query1.field3
FROM query1
WHERE field1 not in (#QuotedValueList(query2.field1)#)

I need to change that "WHERE" line to make this query run even if query2 is
null. It currently doesn't work if query2 is null.

how it is solve it give the solution of its
Last updated:1/17/2011 3:02:57 AM

1 Answers

Anonymous User
Anonymous User

check the null condition in query2 field we apply the if condition and check the record count of that field

SELECT query1.field1, query1.field2, query1.field3
FROM query1
<CFIF query2.RecordCount IS NOT 0>
WHERE field1 not in (#QuotedValueList(query2.field1)#)
</CFIF>

Answer