Steve - why do you need to do this? Is the null field causing a problem, or is it something else? Would it help any to change the WHERE clause to " AND ((o5.OV_ID = b2.OV_ID3) OR b2.OV_ID3 IS NULL) ", so that the clause was true if either the two IDs match or the ID3 value is null?
You could check the OV_ID3 field in advance and set up your query depending on the results of that search. What database are you using? > -----Original Message----- > From: Fogelson, Steve [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 17, 2003 11:00 PM > To: Witango User Group (E-mail) > Subject: Witango-Talk: DBMS Action > > > In the following DBMS action, b2.OV_ID3 may be null. Is there > a way in the WHERE clause to not include "AND (o5.OV_ID = > b2.OV_ID3)" if "b2.OV_ID3 is null". > > If so, would it also be neccessary to not include "o5.OV_Name > as `Option3`" in the SELECT clause? > > If so, how would I eliminate this? > > Thanks > > Steve Fogelson > Internet Commerce Solutions > > SELECT p1.P_ID, > p1.P_SKU, > p1.P_Part_Number, > p1.P_Name, > p1.P_Price1 as `Price`, > b2.B_Quantity, > b2.B_ItemNumber, > p1.V_ID, > b2.OV_ID1, > o3.OV_Name as `Option1`, > b2.OV_ID2, > o4.OV_Name as `Option2`, > b2.OV_ID3, > o5.OV_Name as `Option3` > > FROM Products p1, Basket b2, OptionValue o3, OptionValue o4, > OptionValue o5 WHERE (b2.B_ShopperID = <@var user$U_ID>) > AND (p1.P_Disable Is Null) > AND (b2.P_ID = p1.P_ID) > AND (o3.OV_ID = b2.OV_ID1) > AND (o4.OV_ID = b2.OV_ID2) > AND (o5.OV_ID = b2.OV_ID3) > ORDER BY b2.B_ItemNumber ASC > ______________________________________________________________ > __________ > TO UNSUBSCRIBE: send a plain text/US ASCII email to > [EMAIL PROTECTED] > with unsubscribe witango-talk in the message body > ________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body
