I’m looking for an Access 2007 equivalent to SQL Server’s COALESCE function.
In SQL Server you could do something like:
Person
John Steve Richard
SQL
DECLARE @PersonList nvarchar(1024) SELECT @PersonList = COALESCE(@PersonList + ',','') + Person FROM PersonTable PRINT @PersonList
Which produces: John, Steve, Richard
I want to do the same but in Access 2007.
Does anyone know how to combine rows like this in Access 2007?
Here is a sample User Defined Function (UDF) and possible usage.
Function:
Usage:
An ADO version, inspired by a comment by onedaywhen
From: http://wiki.lessthandot.com/index.php/Concatenate_a_List_into_a_Single_Field_%28Column%29