PDA

View Full Version : SQL or ACCESS help


loverboy260
December 30th, 2003, 02:33 PM
i have two tables
Property[propertyId,landlordId,Street]
Landlord[landlordId,Street]

now i want to make a query in either SQL or ACCESS wherei want a list of all properties with landlords who do not live on the same property ie produce only results where the streets in either table dont match??

thnx

Xandu
December 30th, 2003, 06:14 PM
Hey Thiefboy...

For your particular case:

Ask them to prepare a list of properties they own and dont live on. Then steal it.

X

Desa
December 30th, 2003, 11:59 PM
Originally posted by loverboy260
i have two tables
Property[propertyId,landlordId,Street]
Landlord[landlordId,Street]

now i want to make a query in either SQL or ACCESS wherei want a list of all properties with landlords who do not live on the same property ie produce only results where the streets in either table dont match??

thnx

try this in ACCESS:

SELECT * FROM Property, Landlord
WHERE (((Property.landlordID)=[Landlord].[landlordID]) AND ((Property.Street)<>[landlord].[Street]));

Big-G
December 31st, 2003, 08:29 AM
Originally posted by Desa
try this in ACCESS:

SELECT * FROM Property, Landlord
WHERE (((Property.landlordID)=[Landlord].[landlordID]) AND ((Property.Street)<>[landlord].[Street]));

Right.

But instead of 'select *' , use 'select Property.propertyID'

loverboy260
December 31st, 2003, 10:38 AM
pata nahin yeh gandhu kahan sey beech mein a jata hai (big G not you ;) but Xgandhu! tried to ignore him but still the dog is barking!

but thanks big G and desa!

loverboy260
December 31st, 2003, 11:01 AM
Originally posted by Xandu
Hey Thiefboy...

For your particular case:

Ask them to prepare a list of properties they own and dont live on. Then steal it.

X

or shove them up your arse