You need to use this for null <cfquery name="getData" datasource="cfDS"> SELECT * FROM tblCustomers WHERE orderCount is NULL </cfquery>
And this for records that are not null <cfquery name="getData" datasource="cfDS"> SELECT * FROM tblCustomers WHERE orderCount is not NULL </cfquery> Dave -----Original Message----- From: David K [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 12:37 PM To: CF-Talk Subject: SOT: NULL Madness <Brain_Cramp> Trying to do a simple select query that selects all records with an empty value in an integer column. The table contains 122 records where 12 records have an empty value in the target column. Here's my query... <cfquery name="getData" datasource="cfDS"> SELECT * FROM tblCustomers WHERE orderCount = NULL </cfquery> ...which returns *0* records in the result set. However, if I run this query... <cfquery name="getData" datasource="cfDS"> SELECT * FROM tblCustomers WHERE orderCount <> NULL </cfquery> ...the result set contains 110 records as expected. Isn't the second query the logical opposite of the first? If yes, why does the first query not return 12 records? What is the correct query syntax to return a result set containing those 12 records? </Brain_Cramp> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

