In a field (Phase), I'm trying to have an auto list concatenating values from 2 other fields.
I'm using the pop-up list editor (fields properties dialog).
The fields I created:
- Phases : contain the phases names
- Order : contains a number for each phase (fort sorting purposes)
- Phase : this is where I'm trying my SQL request. Its popup list should contain *Order* & *Phases*
Here's what I've tried (among other things) in the list editor**:
SELECT Phases FROM Phases, CONCAT(Order, ' ',Phases)
This doesn't work.
What partially works (obviously) :
SELECT Order,Phases FROM Phases
But... I don't get the concatenation of both values in my Phase field when I make a selection in the list. Only the number or the phase name.
Any idea?
Thanks!
**(Of course, I've created a "Phases" grid containing Phases + orders, and the grid has been made visible)
Comments
There are two concatenation operators available in Access:
+
; and&
. They differ in how they deal with Null."foo" + Null
returns Null"foo" & Null
returns"foo"
So if you want to update Null
[My Column]
fields to contain"Prefix "
afterwards, use ...But if you prefer to leave it as Null, you could use the
+
operator instead ...However, in the second case, you could revise the
WHERE
clause to ignore rows where[My Column]
contains Null.