[AccessD] Query question

Kaup, Chester Chester_Kaup at kindermorgan.com
Wed Jun 2 15:55:55 CDT 2010


Apparently something else is going on because without the -1 I get 100 records and with it 4 records. If I look at the results each record returns a 0 or 1.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Fred Hooper
Sent: Wednesday, June 02, 2010 3:19 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Query question

Hi Chester,

It looks like "-1" is a synonym for True, and therefore redundant in a Where clause as nothing would be returned unless the Where clause were True
WHERE (
(([Status]='WAGC' And [Design_Fluid_Status_Id]='WI') 
Or ([Status]='WAGW' And [Design_Fluid_Status_Id]='CI') 
Or ([Status]='CI' And [Design_Fluid_Status_Id]='WI') 
Or ([Status]='WI' And [Design_Fluid_Status_Id]='CI'))
=-1)

This would do the same thing:
WHERE 
(([Status]='WAGC' And [Design_Fluid_Status_Id]='WI') 
Or ([Status]='WAGW' And [Design_Fluid_Status_Id]='CI') 
Or ([Status]='CI' And [Design_Fluid_Status_Id]='WI') 
Or ([Status]='WI' And [Design_Fluid_Status_Id]='CI'))

Fred Hooper

On 6/2/2010 3:13 PM, Kaup, Chester wrote:

> This is part of a query that someone gave me. I am not sure what it is really doing. I am thinking it returns a value of -1 if any of the conditions are true. Is that correct? I have not in my limited experience see anything like this before. Is this the best way to do this? Thanks
>
> WHERE ((([Status]='WAGC' And [Design_Fluid_Status_Id]='WI') 
> Or ([Status]='WAGW' And [Design_Fluid_Status_Id]='CI') 
> Or ([Status]='CI' And [Design_Fluid_Status_Id]='WI') 
> Or ([Status]='WI' And [Design_Fluid_Status_Id]='CI'))=-1)
>
>
> Chester Kaup
> Engineering Technician
> Kinder Morgan CO2 Company, LLP
> Office (432) 688-3797
> FAX (432) 688-3799
>
>  
> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.
>
>
>   
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list