need help! (1 Viewer)

mokhechen

Registered User.
Local time
Yesterday, 16:45
Joined
Jul 27, 2012
Messages
14
hi all , i have 2 tabels first one personal info have pnum,name,rank,dateofbirth.....
second have pnum related to pnum in personal info and medals_type .....
there is 12 medals type lets say medal1 2 3 4 5 .......
i want to find who dosent have medal 5 or 3 or 2 in parameter [ ]
and thanks for help! :banghead:
 

mokhechen

Registered User.
Local time
Yesterday, 16:45
Joined
Jul 27, 2012
Messages
14
<> 1 or <>2 like "not like " i want to find persons who dosent has ( medal1 or medal 2 but may be he has medal3) example ; jhon has medal1 and medal2 but he dosent has medal3
 

pr2-eugin

Super Moderator
Local time
Today, 00:45
Joined
Nov 30, 2011
Messages
8,494
Yes.. that is what the <> (not equals) does..
 

mokhechen

Registered User.
Local time
Yesterday, 16:45
Joined
Jul 27, 2012
Messages
14
no lets say " john has medal1 and medal3 , tony has medal4 and medal3 , sam has medal1 and medal4 ............ i wana find who dosent has medal3 answer is" only sam"
not
jhon medal1
tony medal4
sam medal1,medal4
!!!!!!!:confused:
 
Last edited:

pr2-eugin

Super Moderator
Local time
Today, 00:45
Joined
Nov 30, 2011
Messages
8,494
Code:
SELECT pName FROM pTable LEFT JOIN medalTable ON pTable.pNum=medalTable.mNum
WHERE medalTable.medalNumber <>3
Try the above code, by replacing the field names to your table and field names and see if you do not get sam as the output..
 

mokhechen

Registered User.
Local time
Yesterday, 16:45
Joined
Jul 27, 2012
Messages
14
thank u for help
if i want to find who has medal1 and dont have medal3
 

pr2-eugin

Super Moderator
Local time
Today, 00:45
Joined
Nov 30, 2011
Messages
8,494
The same, but now you should have the where as,
Code:
medalTable.medalNumber=1 AND medalTable.medalNumber<>3
 

pr2-eugin

Super Moderator
Local time
Today, 00:45
Joined
Nov 30, 2011
Messages
8,494
Why what is wrong with the code? does it not work? Try working around the suggestions.. or tell us what you need, so we will try to help you.. I don't mind looking at it, though..
 

mokhechen

Registered User.
Local time
Yesterday, 16:45
Joined
Jul 27, 2012
Messages
14
take a look please
 

Attachments

  • New Microsoft Office Access 2007 Database.zip
    21.6 KB · Views: 60

pr2-eugin

Super Moderator
Local time
Today, 00:45
Joined
Nov 30, 2011
Messages
8,494
What am I looking at again?? Please state your problem, and also what you expect??
 

pr2-eugin

Super Moderator
Local time
Today, 00:45
Joined
Nov 30, 2011
Messages
8,494
Yes, but I am not sure which Form / Query / Table I should look at. If you are not stating your problem/what you want I am afraid I can not help you...
 

mokhechen

Registered User.
Local time
Yesterday, 16:45
Joined
Jul 27, 2012
Messages
14
look at query1 please ; i want it to show me only sam ,the only one who doesnt has med3
 

Users who are viewing this thread

Top Bottom