ecawilkinson
Registered User.
- Local time
- Today, 15:56
- Joined
- Jan 25, 2005
- Messages
- 112
Hi all,
To start, I am an experienced 4GL programmer, so I understand programming concepts, but cannot seem to do some very basic things in Access. Let me explain in graphic detail.
I want to make a query that selects depending on the contents of 2 fields from a single table. The problem seems to be that the second filter depends on the results of the first. anyway. The 2 fields concerned are Members.Steward and Members.Activist, the other fields are just information to put on a report and/or label print. Members.Steward has only 4 possible values : "Steward", "Deputy Convenor", "Convenor" or "Contact". I want anyone who is "Steward", "Deputy Convenor" or "Convenor". Easy. But then, I only want "Contact"s that have a non-null value in Members.Activist. In pseudo-code :
If Members.Steward is non-null and Members.Steward <> "Contact" then
select
else
if Members.Steward = "Contact" and Members.Activist is non-null then
select
endif
endif
I am unsure of the correct syntax or where I would put the code. I have tried getting all non-null values from Members.Steward then using an If or Iif in the criteria cell of Members.Activist but to no avail. Unforatunately, I only have a minimal knowldedge of SQL, so cannot attack the problem from that direction.
Whatever I try does not work. I know the solution must be staring me in the face, but after a wasted day I have decided to put my pride aside and ask for help, any of which would be much appreciated.
Thank you,
Chris
To start, I am an experienced 4GL programmer, so I understand programming concepts, but cannot seem to do some very basic things in Access. Let me explain in graphic detail.
I want to make a query that selects depending on the contents of 2 fields from a single table. The problem seems to be that the second filter depends on the results of the first. anyway. The 2 fields concerned are Members.Steward and Members.Activist, the other fields are just information to put on a report and/or label print. Members.Steward has only 4 possible values : "Steward", "Deputy Convenor", "Convenor" or "Contact". I want anyone who is "Steward", "Deputy Convenor" or "Convenor". Easy. But then, I only want "Contact"s that have a non-null value in Members.Activist. In pseudo-code :
If Members.Steward is non-null and Members.Steward <> "Contact" then
select
else
if Members.Steward = "Contact" and Members.Activist is non-null then
select
endif
endif
I am unsure of the correct syntax or where I would put the code. I have tried getting all non-null values from Members.Steward then using an If or Iif in the criteria cell of Members.Activist but to no avail. Unforatunately, I only have a minimal knowldedge of SQL, so cannot attack the problem from that direction.
Whatever I try does not work. I know the solution must be staring me in the face, but after a wasted day I have decided to put my pride aside and ask for help, any of which would be much appreciated.
Thank you,
Chris