Question

BAQ split multiple emails

  • 16 August 2023
  • 2 replies
  • 105 views

How to split multiple e-mails in one record into separate lines?

We are creating a query based on these tables.

 

  1. Customer Table
    1. EMailAddress
    2. NotifyEMail (there can be  multiple emails in one record.  I believe they are separated by semicolon;)
  2. CustUPSEmail Table
    1. EmailAddress (there can be multiple records, or none, related to a customer)
  3. ShipTo Table
    1. EMailAddress
    2. NotifyEMail (there can be  multiple emails in one record.  I believe they are separated by semicolon;)
  4. ShipToUPSEml Table
    1. EmailAddress (there can be multiple records, or none, related to a customer)

2 replies

Userlevel 3

I haven’t tried these solutions in a BAQ, but I have used them in SQL directly to split a single column into multiple rows.

https://stackoverflow.com/questions/5493510/turning-a-comma-separated-string-into-individual-rows

https://www.saurabhmisra.dev/sql-server-convert-delimited-string-into-rows/

https://stackoverflow.com/questions/11018076/splitting-delimited-values-in-a-sql-column-into-multiple-rows

Userlevel 2

Dear Benton, 

 

I know I’ve seen formulas here before, which split strings on a delimiter in a BAQ calculated field.  I’m searching for “BAQ split” and one of the posts is this one where Andrew uses SUBSTRING and CHARINDEX commands to split strings.  It helps to remember that most, but not all, SQL commands, functions and operators work in the Calculated Field editor, though they may not be included in the clickable tools.

 

HTH

Monty.

Reply