1
Good afternoon Dear Friends,
I am developing a report with some necessary standards, I will not delve into the standards for the query, but fact is that I "managed" to make a Query with the necessary requirements through concatenation, which was so:
SELECT
'0101010' + STUFF('000000000000000', 14-len(P.CODIGO_PESSOA), 14, P.CODIGO_PESSOA) + ' 02'+STUFF(' ',1,len(P.NOME), P.NOME) +'0701'+
'
0201010' + STUFF('000000000000000', 14-len(P.CODIGO_PESSOA), 14,
P.CODIGO_PESSOA) + ' 0200103'+ @DT_ATUAL +'0933333'
From bd.PESSOAS P
Where P.CODIGO_PESSOA <> ''
order by
P.NOME
This report needs to be exported to a TXT file and the database result is perfect as it presents the information exactly as accurate, requiring only "copy" to the TXT:
The problem occurs because as I did through concatenation, obviously the result of the "two lines" (I am considering the result after the line break as another line) are in the same record.
When I take this Query to the report of our system, which only allows us to export reports to EXCEL causing that when copying the data from the exported spreadsheet to a TXT, the line break is lost, since it was inserted through "formatting".
The result I need is that the line before the break (+'0701'+
') be a record and the row after the break be another record, all in the same "column" in this way:
That’s possible?
Thank you so much for your attention.
Sensational Bruno! It was perfect. Thank you very much!
– Otávio Augusto
You’re welcome @Otávioaugusto
– bruno