HELP ME IN EXPRESSION IN QUERY

B

Bart

I have a query with below output

Ref No Status Remarks1 Remarks2 Remarks3 Remarks4 Remarks5
1 Closed Yes
2 Closed No
3 Closed Yes No
4 Closed No Yes Yes

I want to have another column with name "OVERALL REMARKS" with condition
below:

If any of the Remarks from Remarks1 to Remarks5 has "NO" value, then the
OVERALL REMARKS should be "NO". How would i do this?

Below is my current SQL

SELECT Main.[Ref No], Main.Status, [Action Plan 1A].Remarks1, [Action Plan
2A].Remarks2, [Action Plan 3A].Remarks3, [Action Plan 4A].Remarks4, [Action
Plan 5A].Remarks5
FROM ((((Main LEFT JOIN [Action Plan 1A] ON Main.[Ref No] = [Action Plan
1A].[Ref No]) LEFT JOIN [Action Plan 2A] ON Main.[Ref No] = [Action Plan
2A].[Ref No]) LEFT JOIN [Action Plan 3A] ON Main.[Ref No] = [Action Plan
3A].[Ref No]) LEFT JOIN [Action Plan 4A] ON Main.[Ref No] = [Action Plan
4A].[Ref No]) LEFT JOIN [Action Plan 5A] ON Main.[Ref No] = [Action Plan
5A].[Ref No]
WHERE (((Main.Status)="Closed"));
 
J

John Spencer

Perhaps the following will work for you

, IIF(Remarks1="no" or Remarks2 = "No" or Remarks3 = "no" or Remarks4 =
"no" or Remarks5 = "No","No","NO Nos Nanette") as OverallRemarks

That assumes that your fields contain the string "NO"

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top