I have a table in my SQL Server database with a column of type NTEXT
. The column holds address information, like this:
"Company name
Street + number
Postalcode + City
Country"
Sometimes the country is not there, but the first 3 lines are always there.
How would I go about selecting only line 3?
Each line is separated with CR + LF (\r\n)
I need this as part of a SQL Server stored procedure and the column I use is called RecipientAddress
The reason why I need this to be done within an SP is that I use the data to create a Crystal Report.
Or is there a way to do this within a formula in Crystal Reports?
EDIT: The datatypes used for the fields cannot be changed at the moment, since fields are part of an ERP system, where we are not able to change the datatypes.