Maggie Barr
Board Regular
- Joined
- Jan 28, 2014
- Messages
- 188
Hello and thank you in advance if you can help,
I am trying to create a column in a query that compiles/concatenates information from other columns when certain criteria are met. The problem I am encountering is how to put it in terms of Concatenate IIf, or if that is even valid syntax within the expression builder, within the formula and how to word this so it will work. I have written out, roughly, what I need, but cannot for the life of me figure out the right syntax to pull it off. If you have any advice, I would appreciate input.
Below is an outline of what I need and my attempt at writing it out. Part of the problem is that I want the fields concatenated with &"; " & between the fields, but only if not "" (blank) as a result of the IIf statement. I think perhaps I should have AND syntax in there, but I am unsure. The [Updated_Non-Atlas_Flag_Result] = "NewFlag", then concatenate IIf according to the subsequent criteria:
Thanks if you can offer any advice, much appreciated.
Maggie
New Flag (Why Flagged):
IIf([Updated_Non-Atlas_Flag_Result] = "New Flag",
IIF([PORTAL_TYPE] = "Not Atlas Portal", "Not Atlas Portal", ""
&"; " &
IIF([Data Source] = "Small File", "Unvetted Record", ""
&"; " &
IIF([Species_Type] = "NonBreeding_Maine", "Not Maine Breeder", ""
&"; " &
IIF([Invalid_Code_4_Species] = "Invalid", "Invalid Code for Species", ""
&"; " &
IIF([OBS_DATE_ACCEPTANCE] = "OUTSIDE", "Outside safe dates", ""
&"; " &
IIF([OBS_Buffer_DATE_ACCEPTANCE] = "OUTSIDE", " Outside Buffer", "")))))))
I am trying to create a column in a query that compiles/concatenates information from other columns when certain criteria are met. The problem I am encountering is how to put it in terms of Concatenate IIf, or if that is even valid syntax within the expression builder, within the formula and how to word this so it will work. I have written out, roughly, what I need, but cannot for the life of me figure out the right syntax to pull it off. If you have any advice, I would appreciate input.
Below is an outline of what I need and my attempt at writing it out. Part of the problem is that I want the fields concatenated with &"; " & between the fields, but only if not "" (blank) as a result of the IIf statement. I think perhaps I should have AND syntax in there, but I am unsure. The [Updated_Non-Atlas_Flag_Result] = "NewFlag", then concatenate IIf according to the subsequent criteria:
Thanks if you can offer any advice, much appreciated.
Maggie
New Flag (Why Flagged):
IIf([Updated_Non-Atlas_Flag_Result] = "New Flag",
IIF([PORTAL_TYPE] = "Not Atlas Portal", "Not Atlas Portal", ""
&"; " &
IIF([Data Source] = "Small File", "Unvetted Record", ""
&"; " &
IIF([Species_Type] = "NonBreeding_Maine", "Not Maine Breeder", ""
&"; " &
IIF([Invalid_Code_4_Species] = "Invalid", "Invalid Code for Species", ""
&"; " &
IIF([OBS_DATE_ACCEPTANCE] = "OUTSIDE", "Outside safe dates", ""
&"; " &
IIF([OBS_Buffer_DATE_ACCEPTANCE] = "OUTSIDE", " Outside Buffer", "")))))))