Removing Line Breaks or New Line Characters in a SQL Query | Quisitive
Power Platform Quick Start: Power Platform Consulting Services - Woman on computer, a citizen developer
Removing Line Breaks or New Line Characters in a SQL Query
October 3, 2013
Quisitive
Struggling with the long description field might containing new line characters when copying into Excel?

On many occasions, I am asked to run a quick ad-hoc query and dump the results into an Excel spreadsheet. This is typically a piece of cake except in those cases when I am asked to include a long description field. In some cases, the long description field might contain new line characters. This wreaks havoc when I try to copy the results into Excel or save to a comma-delimited list, because the line breaks cause the row in Excel to break out into multiple rows. Messy to clean up.

If you want to ensure that your description field does not return any line breaks and new lines, it is simple to remove those straight in the SQL query:

Here is how to do it: