View Single Post
  #5  
Old May 5th, 2010, 11:25 PM posted to microsoft.public.access.queries
Dorian
external usenet poster
 
Posts: 542
Default Need some query help.....

If you want to pull data from more than one table, you need to JOIN the two
tables based on a common field. E.g.
SELECT Project.*, TES.* FROM Project INNER JOIN TES ON Project.Badge =
TES.Bdg
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"James" wrote:

Great, that worked beautifully! I ended up using IIF([Test
Stats].TestType="Eng",[Project].[BadgeET],[Project].[Badge]). Any other
condition would default to display [Project].Badge (instead of null by using
the nested IIF)

To add to this, now that I have either Badge or BadgeET, how can I use that
to display other information. ie.....

If TestType = "Eng" then
Display TES.LastName & ", " TES.FirstName Where TES.Bdg =
Project.Badge
ElseIf TestType = "Pkg" then
Display TES.LastName & ", " TES.FirstName Where TES.Bdg =
Project.Badge
End if

TES is the name of another table with fields named Bdg, FirstName, and
LastName so i should be able to use the "badge" to locate the name....

Thanks again!