Also, try running all this stuff in your database's query analyzer/consoler/etc. to see what's going on in the database directly.
I'm by no means a SQL expert, but basically here's the lo-down: AND just won't work because a field won't ever have two values so you'll always get zero results back. Based on what it looks like you're trying to do, OR should work, and is the same thing as IN in this situation as far as I can tell. (I'm not sure what you mean by "I want to combine the two".) On Wed, 26 Jan 2005 12:13:20 -0600, Daniel Elmore <[EMAIL PROTECTED]> wrote: > Can you tell us what exactly you mean by "didn't work". What database server > are you using? > > Daniel Elmore > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Ron Mast > Sent: Wednesday, January 26, 2005 11:52 AM > To: [email protected] > Subject: RE: simple query hang up > > I've tried Where cust in (9046,8479) didn't work. > > OR is not what I want to do because I want to combine that 2...:) > > UNION worked...what the heck is going on? > > <CFQUERY name="getPRC" datasource="#DSN#"> > SELECT ITEM, CURR > FROM PRCL01 > WHERE CUST = 9046 > union > SELECT ITEM, CURR > FROM PRCL01 > WHERE CUST = 8479 > order by item > </CFQUERY> > > Ron Mast > Webmaster > Truth Hardware > Ph: 507-444-4748 > Fx: 507-444-5361 > www.truth.com > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Ryan Everhart > Sent: Wednesday, January 26, 2005 11:48 AM > To: [email protected] > Subject: Re: simple query hang up > > Ron, > Try this, > > WHERE CUST IN (9046,8479) > > OR you could use > > WHERE Cust = 9046 OR Cust = 8479 > > But I would recommend the first. > > Ryan > > On Wed, 26 Jan 2005 10:54:37 -0600, Ron Mast <[EMAIL PROTECTED]> wrote: > > > > > > Hi All, > > > > <CFQUERY name="getPRC" datasource="#DSN#"> > > > > SELECT ITEM, CURR > > > > FROM PRCL01 > > > > WHERE CUST = 9046 > > > > AND CUST = 8479 > > > > </CFQUERY> > > > > > > > > Why does this return 0 records, but separately returns the correct > amount of > > records. > > > > > > > > Using CFServer5.0 > > > > > > > > Something simple I'm sure. > > > > > > > > > > Ron Mast > > > > Webmaster > > > > Truth Hardware > > > > Ph: 507-444-4748 > > > > Fx: 507-444-5361 > > > > www.truth.com > > > > > ---------------------------------------------------------- > To post, send email to [email protected] > To unsubscribe: > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > To subscribe: > http://www.dfwcfug.org/form_MemberRegistration.cfm > > ---------------------------------------------------------- > To post, send email to [email protected] > To unsubscribe: > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > To subscribe: > http://www.dfwcfug.org/form_MemberRegistration.cfm > > > -- Matt Woodward [EMAIL PROTECTED] http://www.mattwoodward.com ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm
