2 tables to 1 query - sort in date order

shenty

Registered User.
Local time
Today, 09:54
Joined
Jun 8, 2007
Messages
119
I have two tables that i want to combine into 1 query in date order - the first table contains information such as 'cattle id', 'date of birth', 'sex', 'breed' etc. ... the 2nd table contains Artificial Insemination dates & bull names (serving dates) for cattle. I want to combine the tables into one query that will list in 'ID' then date order.

Is this possible ?

Also in my list box there are 2 columns which are tick boxes but they show as -1 and 0 values, how can i change this?
 
I have two tables that i want to combine into 1 query in date order - the first table contains information such as 'cattle id', 'date of birth', 'sex', 'breed' etc. ... the 2nd table contains Artificial Insemination dates & bull names (serving dates) for cattle. I want to combine the tables into one query that will list in 'ID' then date order.

Is this possible ?

Yes. You will probably want to use the Access Query Grid to construct the query. There are examples in the Help file on how to use the thing. Give yourself some time to learn it and ultimately it will be a big help to you. For the problem at hand, make sure the second table has a cattle_id field and it is defined as a foreign key to cattle_id in the first table where it should be defined as a primary key. The Access Query grid will help you link the tables (using cattle_id) and produce SQL like the following...

Code:
SELECT     dateOfBirth.Table1, sex.Table1, etc.Table1, 
               A_Date.Table2, etc.Table2
FROM       Table1 INNER JOIN Table2
               ON Table1.Cattle_Id = Table2.Cattle_Id
ORDER By  Table1.dateOfBirth DESC
Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom