I’m trying to write a report that I will send out in Excel which concatenates two records into the same cell, displaying a carriage return between each record. I have been trying with ||chr(10) || chr(13) || but this only works if I run as a script and not when I run the query in Excel.
Is there a better way of forcing a carriage return?
The select statement looks like this:
select distinct
cap.cap_stuc "Application ID"
,stu.stu_surn "Surname"
,initcap(stu.stu_fnm1) "First Name"
,min(decode(rn, 1, choices.cap_pref)) || ' ' || min(decode(rn, 1,choices.cap_mcrc)) || ' ' || min(decode(rn, 1, choices.crs_name)) || chr(10)||chr(13) || min(decode(rn, 2, choices.cap_pref)) || ' ' || min(decode(rn, 2, choices.cap_mcrc)) || ' ' || min(decode(rn, 2, choices.crs_name)) "App Details"
Thanks
For a Windows system, I believe you have it backwards and it needs to be … || chr(13) || chr(10) || …
It should be CR + LF, which is ASCII characters 13 + 10, not LF + CR.
You could also try writing a Java stored procedure to return your data, and then putting in a newline is easy.