Queried Reports

Mac_Wood

Registered User.
Local time
Today, 13:48
Joined
Dec 10, 2005
Messages
65
Hi,
Would you humour me for a moment while I explain my query problem.
I work in Air Freight at Heathrow where all consignments are processed under an Airwaybill (AWB), an eleven digit number where the first three digits (prefix) denotes which airline the freight has travelled with. For security reasons a lot of the freight is X-Rayed and I am designing a database to log these shipments. Sometimes freight will arrive at Heathrow on one airline and then travel on to its' destination (this is called a transhipment) on another having first been X-Rayed.

What I want to do is produce end-of-month reports for each airline detailing which of their freight has been X-Rayed. I have created queries which filter the data for each airline according to the first three digits of the AWB, simple. On the data entry form I have a combo box which allows the operator to select which airline the freight has transhipped on. My problem is in the query where I have used the Or operator to "catch" these records e.g in the United Airlines report where the prefix is 016 I have all the records that begin with this prefix plus those that went on this airline but also those that went on a different airline but have the 016 prefix. It is these last records that I only want to appear once on the report of the airline it finished its' journey with.:o
 
My problem is in the query where I have used the Or operator to "catch" these records e.g in the United Airlines report where the prefix is 016 I have all the records that begin with this prefix plus those that went on this airline but also those that went on a different airline but have the 016 prefix.
Mac,

I'm not quite sure I follow all of that, but see if the following will help you...

* Query all United Airlines shipments with 016 prefixes...
Code:
WHERE table.airline = "United Airlines"
   [B][COLOR="Red"][U]AND[/U][/COLOR][/B] table.code = 016
* Query all United Airlines shipments plus ANY 016 prefixes (on ANY airline)...
Code:
WHERE table.airline = "United Airlines"
   [B][COLOR="Red"][U]OR[/U][/COLOR][/B] table.code = 016
 
And if you want to find all the 016 codes not going with United Airways use
Code:
WHERE table.airline not = "United Airlines"
 AND table.code = 016
 
And if you want to find all the 016 codes not going with United Airways use
Code:
WHERE table.airline not = "United Airlines"
 AND table.code = 016

Wouldn't that be <> "United Airlines" ?

I don't think you can use

NOT =

because Access will expect <> which is NOT =
 
As usual you are absolutely right, Bob.:o I really must learn not to post first thing in the morning. The body was awake but the brain was still dozing.:D
 
Thanks guys for your help. As ever I know I can find the answer to my questions here. all sorted now.
 

Users who are viewing this thread

Back
Top Bottom