aggregating functions for text?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Piotr Sobolewski

    aggregating functions for text?

    Hello,

    are there any aggregating functions in Access that can concatenate (glue
    together) text?
  • fredg

    #2
    Re: aggregating functions for text?

    On Fri, 26 Sep 2008 07:16:29 +0200, Piotr Sobolewski wrote:
    Hello,
    >
    are there any aggregating functions in Access that can concatenate (glue
    together) text?
    Perhaps an example of what you want would have been helpful.

    ="This is a Text message." & " " & "This is an additional message."

    Is that what you mean?
    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail

    Comment

    • Allen Browne

      #3
      Re: aggregating functions for text?

      "Piotr Sobolewski" <NIE_DZIALA@gaz eta.plwrote in message
      news:gbhr7d$h3v $1@inews.gazeta .pl...
      >
      are there any aggregating functions in Access that can concatenate
      (glue together) text?
      If you are trying to concatenate values from related records into a string
      to use with the main record, use a function like this:


      If you just want to stick together an unpredictable number of strings that
      you want to pass in, use a functon that accepts a ParamArray, like this:
      Function ConcatFields(st rDelim As String, ParamArray varList()) As Variant
      Dim strout As String
      Dim i As Integer

      For i = LBound(varList) To UBound(varList)
      If Not IsNull(varList( i)) Then
      strout = strout & varList(i) & strDelim
      End If
      Next
      i = Len(strout) - Len(strDelim)
      If i 0 Then
      ConcatFields = Left(strout, i)
      Else
      ConcatFields = Null
      End If
      End Function

      --
      Allen Browne - Microsoft MVP. Perth, Western Australia
      Tips for Access users - http://allenbrowne.com/tips.html
      Reply to group, rather than allenbrowne at mvps dot org.

      Comment

      • Piotr Sobolewski

        #4
        Re: aggregating functions for text?

        Allen Browne wrote:
        >are there any aggregating functions in Access that can concatenate
        >(glue together) text?
        >
        If you are trying to concatenate values from related records into a string
        to use with the main record, use a function like this:
        (...)
        Thanks a lot!

        Comment

        Working...