Andromeda31
Registered User.
- Local time
- Today, 12:13
- Joined
- Oct 14, 2009
- Messages
- 33
A table with four fields of the same kind of data needs to be combined into a single field using commas as separators.
I'm trying to create a concatenated field in a query initially which I'll change to an update query, separating the data with commas
however if the fields are empty I still get the comma's :
gives
field, field1, field2, field3 but also annoyingly
field, field1,,
field, ,,
etc
To get round this I have successfully found a way to combine the first two columns without getting the comma if [services1] is empty:
However, I can't get the syntax or logic correct to extend this to the other 2 fields.
Wonder if anyone could give a pointer to nesting it correctly?
it must be something like:
This familiar to anyone out there with 5 minutes to spare?
MTIA
I'm trying to create a concatenated field in a query initially which I'll change to an update query, separating the data with commas
however if the fields are empty I still get the comma's :
Code:
expr1:[services]& "," &[services1]& "," &[services2]&","&[services3]
gives
field, field1, field2, field3 but also annoyingly
field, field1,,
field, ,,
etc
To get round this I have successfully found a way to combine the first two columns without getting the comma if [services1] is empty:
Code:
expr1: IIf(IsNull([services1]),[services],[services] & "," & [services1])
However, I can't get the syntax or logic correct to extend this to the other 2 fields.
Wonder if anyone could give a pointer to nesting it correctly?
it must be something like:
Code:
IIf(IsNull([services1]),[services],[services] & "," & [services1]) AND
IIf(IsNull([services2]),[services] &[services1] & "," & [services] & "," & [services1]& ","[services2]) etc etc
This familiar to anyone out there with 5 minutes to spare?
MTIA