I'm really tired and I'm about to go back to bed, so forgive the lack of information in this message. I think you are looking for a SQL outer join where (addresstype = 1 and address = "") or (addresstype = 2 and address = "") or (addresstype = 3 and address = ""). When I wake up I'll check back to see if you got this figured out.
At 10:06 PM 1/30/02 +1100, you wrote: >Hi > >I've got a looping problem that is probably quite simple for most people >but has me baffled > >I have a list of allowed address types (Home, Shop, Head Office) >A business can have 1 of each address type but may have 1,2 or 3 of them >I want to find (for an individual business) what address types they have >NOT got > >ie business has Home and Shop address type - I want to get just Head Office > >My tables are: > >tblAddressesAT (ID, AddressType) > >tblAddresses (AddressID, AddressType....) > >I think I have to loop thru tblAddresses then do a NOT IN select query for >tblAddressesAT ... but that's when I get lost > >Any help at all would be greatly appreciated > >Seamus > ______________________________________________________________________ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation � $99/Month � Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

