Forum Discussion

Klax0's avatar
Klax0
Copper Contributor
Jun 29, 2023
Solved

What I could do in Oracle, MySQL, SQL Server I cannot do in Access Jet SQL: Concatenate.

I just want to concatenate address fields in a report.   It seems that I have to do all this IFF... null business:   The first IIF is the only way to report all the combinations of Surname/, /For...
  • Karl_Donaubauer's avatar
    Jun 29, 2023

    Hi,

     

    How about these expressions?

     

    [Surname] & IIf([Surname]+[Forenames]>"", ", ") & [Forenames]

    Nz([AddrList Mobile], [AddrList Land Line])

     

    Explanation: & is the standard concatenation operator in Access and JET SQL. With + you get NULL if one of the parts is NULL. Therefore the check for your separator. Nz() is an Access function that gives back the first expression or if the first one is NULL, the second one.

     

    Servus
    Karl
    ****************

    Access Bug Trackers

    Access News
    Access DevCon

     

Resources