combine 4 fields seperated with coma

Falcon88

Registered User.
Local time
Today, 15:54
Joined
Nov 4, 2014
Messages
318
all dears

hiiii

i have a table contains some fields:
[FirstStage]
[SecondStage]
[SceintificName]
[PublicName]


i want to combine them in Query as:
Code:
CombinedField:[FirstStage]&" , "&[SecondStage]&" , "&[SceintificName]&" , "&[PublicName]

Sometimes, one of the fields that i want to combine may not contain a value .
how to handling coma "," to be hiden ?

i try this
https://support.office.com/en-za/ar...pression-d1653b60-dd60-4a05-9747-6b31ba4c4eed

but its gives me wrong results

note: some values sometimes contains digits.
 
CombinedField: [FirstStage] & ( ", " + [SecondStage]) & (", " + [ScientificName]) & (", " + [PublicName])
 
Last edited:
note: some values sometimes contains digits.
are they numeric?

Code:
CombinedField: IIf(Not IsNull([FirstStage]), [FirstStage] & "", [FirstStage]) & _
  (", " + IIf(Not IsNull([SecondStage]), [SecondStage] & "", [SecondStage])) & _
  (", " + IIf(Not IsNull([ScientificName]), [ScientificName] & "", [ScientificName])) & _
  (", " + IIf(Not IsNull([PublicName]), [PublicName] & "", [PublicName]))
 
ok that's good

but if [PublicName] and [ScientificName] fields in query not in Table .
this give wrong
 
in same query? then use the expression that created this calculated fields. ie:

PublicName: [Field1] & [Field2]

then use the expression [Field1] & [Field2] to replace PublicName in the expression i gave you.

wait, in your first post you mentioned the PublicName and ScientificName are all fields in your table.
 

Users who are viewing this thread

Back
Top Bottom