Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

BTEQ not remove trailing blank - response (2) by PeterSchwennesen

$
0
0

Hi Dieter
The outer part of my select is:
So this means that if I format the last column like: ________123 in stead of 123______ then I get the defined record legnth? (_ is space)
br
Peter Schwennesen
SELECT SUBSTR(CAST(A.UgeId AS CHAR(6)),3,6) ||
SUBSTR(CAST(A.ButikId AS CHAR(20)),1,7) ||
CAST(SUBSTR(CAST(PluId AS CHAR(14)), 1 , INDEX(CAST(PluId AS CHAR(14)), '.') - 1) || '' AS CHAR (13)) ||
SUBSTR(CAST((CASE
WHEN A.OmsSalgStk < 0 THEN 10000000
ELSE A.OmsSalgStk + 10000000
END) AS CHAR(8)) ,3) ||
SUBSTR(CAST((CASE
WHEN A.OmsSalgInclMomsDKK < 0 THEN 1000000000
ELSE A.OmsSalgInclMomsDKK + 1000000000
END) AS CHAR(10)),2) ||
SUBSTR(CAST((CASE
WHEN A.AvgPris < 0 THEN 10000000
ELSE A.AvgPris + 10000000
END) AS CHAR(8)) ,2) ||
SUBSTR(CAST(A.Varetekst AS CHAR(30)),1,30) ||
SUBSTR(A.MaengdeEnhedNavn,1,3) ||
SUBSTR(CAST((CASE
WHEN A.Volumen < 0 THEN 1000000
ELSE A.Volumen + 1000000
END) AS CHAR(7)),2) ||
SUBSTR(CAST(A.BestNr AS CHAR(13)),1,13)
(TITLE '') --AS detail
FROM (
SELECT ...
) AS A
ORDER BY 1 DESC
;


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>