PROBLEM IN CHECK THE NULL CONDITION IN QUERY

Vikas Giri

Total Post:13

Points:91
Posted by  Vikas Giri
 1850  View(s)
Ratings:
Rate this:
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
  1. Mahesh Rawat

    Post:11

    Points:77
    Re: problem in check the null condition in query

    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

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!