Question Ms access query

vks.gautam1

Well-known member
Joined
Oct 10, 2008
Messages
78
Location
Chandigarh, India
Programming Experience
Beginner
I have two tables.
A) Test1
B) USSD_MASTER

Field in Test1
a) Mob
b) Name

Field in USSD_MASTER
a) Mob
b) date
c) Name

Test1 table have unique values. But USSD_MASTER table have many duplicate values..
now when i am making queries it is giving many duplicate values.

" select distinct test1.mob , test1.name , ussd_master.date , ussd_master.name from test1 inner join ussd_master on test1.mob=ussd_master.mob "

i want unique values of latest date
 
Basically, at the moment your query is saying "for every record in ussd_master where the field mob matches, return the record" - given that your ussd_master table holds multiple rows with mob repeated, your resultant record set is going to contain multiples.

Try adding your 'Name' field to your join criteria and you should see the required result.
 
Back
Top