Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Urgent Help in Access Query is needed
Message
De
08/05/2002 15:42:15
Jason Dalio
Northern Interior Regional Health Board
Prince George, Colombie Britannique, Canada
 
 
Information générale
Forum:
Microsoft Office
Catégorie:
Access
Divers
Thread ID:
00654062
Message ID:
00654200
Vues:
17
This is where you will wantto use your inner and outer joins (in SQL syntax). To do so through the designer window try the following to see how it works:

Table 1: Staff
Column1: StaffID - Autonumber
Column2: StaffName - Text
(populate Table 1 with random data)

Table 2: StaffAllergies
Column1: StaffID - Number
Column2: AllergyType - Text
(populate Table 2 with StaffIDs corresponding to StaffID in table Staff and random text for AllergyType so that for every StaffID in Staff you have at least one record with the same StaffID in StaffAllergies)

Open up a new query and add Staff and StaffAllergies. Use your mouse and click and hold on StaffID in Staff. Then drag to StaffID in StaffAllergies. You should now have a Join represented by an line. Add fields StaffID from Staff and AllergyType from StaffAllergies. Execute the query and check your results.

Save your query. Now go back to your Table view and add a new entry to Staff but DON'T add a corresponding entry to StaffAllergies. Go back to your query and execute it again. You will see the new entry you put in to Staff does not appear since there is nothing to join to in StaffAllergies.

Now go back to designer view. Right-click on the line that represents your Join and select Join Properties. You will see a window pop-up with three choices. Have a read through of the choices. Choose item 2 (Select ALL records from 'Staff' and only those records from 'StaffAllergies' where the joined fields are equal. Click OK. execute your query again. You should see in the results the new StaffID with an empty AllergyType value (since no join exists). Hope this helps explain it a bit.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform