
Originally Posted by
staceyo
Hi,
I have biological data in a query and need a column which has brings all the data together. But not all the cells have information in them.
So I would like one column (called Taxa) which combines all the data together.
So far I have tried using an IIF statement, but where some of the data is null, I get an extra space, and can't work out how best to combine these columns into one.
This is the IIF statement I have so far:
Taxa: IIf([SUBGENUS] Is Not Null,[GENUS] & " " & "(" & [SUBGENUS] & ")" & " " & [SPECIES] & " " & [AUTHORITY],[GENUS] & " " & [SPECIES] & " " & [AUTHORITY])
Oh, and should subgenus be present, it needs to have brackets around it...!
Any help would be very much appreciated!
Thanks!

If you want brackets try this:
Code:
Taxa: [GENUS] & IIf(IsNull([SUBGENUS], " " , " [" & [SUBGENUS] & "] ") & [SPECIES] & " " & [AUTHORITY],
If you want Parentheses try this:
Code:
Taxa: [GENUS] & IIf(IsNull([SUBGENUS], " " , " (" & [SUBGENUS] & ") ") & [SPECIES] & " " & [AUTHORITY],