Home > DeveloperSection > Forums > problem in check the null condition in query
Vikas Giri
Vikas Giri

Total Post:13

Points:91
Posted on    January-14-2011 1:51 AM

 Cold Fusion Cold Fusion 
Ratings:


 1 Reply(s)
 1554  View(s)
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


Mahesh Rawat
Mahesh Rawat

Total Post:11

Points:77
Posted on    January-17-2011 3:02 AM

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>

Don't want to miss updates? Please click the below button!

Follow MindStick