[AccessD] Query question

Fred Hooper fahooper at trapo.com
Wed Jun 2 15:19:05 CDT 2010


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.
>
>
>   



More information about the AccessD mailing list