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

In SQL mode, enter in your query:
IIF(TestType='Eng',Project.BadgeET,IIF(TestType='P kg',Project.Badge,NULL))
As ProjBadge

This also outputs NULL if neither condition applies.
You should look up IIF in Access Help.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"James" wrote:

I'm very new to Access. I was wondering how I could display a field in a
query that is conditional. I will do my best to explain...

I want to add a field to my query that grabs the info from Project.Badge or
Project.BadgeET depending on if the field TestType is displaying "Eng" or
"Pkg"

so it would be something like this

If TestType = "Eng" then
Display Project.BadgeET
ElseIf TestType = "Pkg" then
Display Project.Badge
End if

im assuming I would type some formula in the Criteria section?? but under
field, i can only select Project.Badge OR Project.BadgeET, not both.

Thanks in advance for the help.