"status = null" is wrong... It should be "status is null". (Generally
any logical test with a null value will fail except "IS" or "IS NOT".
Not sure if this applies to oracle but that is the sql standard.)
Also, you didn't put ()'s around the "status <> 'Removed' OR Status =
NULL" part so your query logic is not what you want it to be.
So:
.... AND (status <> 'Removed' OR Status IS NULL) ORDER ...
Mark
-----Original Message-----
From: Daniel Kessler [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 09, 2007 11:51 AM
To: CF-Talk
Subject: re: SQL status <> 'Removed
Unfortunately, my Reply posts didn't show, so I'm going to answer these
again.
> Are they null? Null is always not ever equal to anything.
>
> Perhaps you want and (isnull(status,'') <> 'Removed') (MS SQL)
Sorry, I should've mentioned the database is Oracle. So this didn't
work and produced an error.
> So is the field NULL if there are no records there? If so, then I
> think that you just add an OR clause.
>
> SELECT service_population,agency,city,state,int_agency_id, ROWNUM AS
> r, COUNT(agency) OVER() AS rowcount FROM internships WHERE 1=1 AND
> dept = 'knes' AND status <> 'Removed' OR Status = NULL ORDER BY
> UPPER(agency) ASC
This didn't produce an error, but also didn't show any more records than
it did without the status=null.
Thanks for replying guys - any other suggestions are welcome.
--
Daniel Kessler
University of Maryland College Park
School of Public Health
Suite 2387 Valley Drive
College Park, MD 20742-2611
Phone: 301-405-2545
http://hhp.umd.edu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion is delivering applications solutions at at top companies
around the world in government. Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285846
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4