It looks like you need parentheses around your OR statement rather than individual qualifier statements.
SELECT * FROM SomeTable WHERE (Email = '[EMAIL PROTECTED]' OR SEmail = '[EMAIL PROTECTED]') AND IsDeleted = 0 AND Password = 'somepassword' AND Approved = 1 AND Registered = 1 Matthew Small IT Supervisor Showstopper National Dance Competitions 3660 Old Kings Hwy Murrells Inlet, SC 29576 843-357-1847 http://www.showstopperonline.com -----Original Message----- From: Tony Carcieri [mailto:[EMAIL PROTECTED]] Sent: Monday, December 02, 2002 2:56 PM To: CF-Talk Subject: RE: OT - SQL Help I just removed all the asp stuff and this is what gets sent. SELECT * FROM SomeTable WHERE (Email = '[EMAIL PROTECTED]') OR (SEmail = '[EMAIL PROTECTED]') AND (IsDeleted = 0) AND (Password = 'somepassword') AND (Approved = 1) AND (Registered = 1) -----Original Message----- From: Matthew Small [mailto:[EMAIL PROTECTED]] Sent: Monday, December 02, 2002 2:48 PM To: CF-Talk Subject: RE: OT - SQL Help You to see exactly what SQL Statement being sent to the db. How about displaying the sql string before it is processed and send that to the list. Matthew Small IT Supervisor Showstopper National Dance Competitions 3660 Old Kings Hwy Murrells Inlet, SC 29576 843-357-1847 http://www.showstopperonline.com -----Original Message----- From: Tony Carcieri [mailto:[EMAIL PROTECTED]] Sent: Monday, December 02, 2002 2:38 PM To: CF-Talk Subject: RE: OT - SQL Help Exactly!!! But it is not working that way. I just sent a previous email explaining this. -----Original Message----- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: Monday, December 02, 2002 2:36 PM To: CF-Talk Subject: RE: OT - SQL Help > Sorry for the OT but this should be a quick answer. > This is in ASP (sorry). > > If I have the following: > sql = "SELECT * FROM SomeTable " > sql = sql & "WHERE Email = '" & Request("un") & "'" > sql = sql & " OR SEmail = '" & Request("un") & "'" > sql = sql & " AND IsDeleted = 0 " > sql = sql & " AND Password = '" & Request("pw") & "'" > sql = sql & " AND Approved = 1 " > sql = sql & " AND Registered = 1 " > > Where Email is the "primary" email and SEmail is a > "secondary" email address (both are different addresses). > If the submission doesn't match the first then it matches > the second, how do I account for that? Right now, I am > getting an error because the record doesn't match. You shouldn't be getting an error if the record doesn't match, you should just not get any records back if none match. Randall's suggestion about using parentheses should take care of your stated problem (you want to compare the value to both fields, and if it matches either, you want to select the record, right?) Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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

