|
<<SNIP>>I would like to use the Case statement to ensure the sub
account code is formatted correctly when I convert the numeric values
to character. ex when the sub account = 0, then '000'; when the sub
account = 10, then '010'; when the sub account = 100, then '100'.
Here is what I have so far:
Select orgno concat '-' concat major concat '-'
Case
When sub< 10 THEN
concat right('00' || Rtrim(SUBSTR(sub,1,3)), 3)
When sub>= 10 and sub< 100 THEN
concat right('0' || Rtrim(SUBSTR(sub,1,3)), 3)
Else
concat sub
End as FullGL,
net2,ytd2
from glsum12
where orgno = 30 and major between 97319 and 97456
order by major
The interactive SQL session is yelling at me, saying that the Case keyword is not expected at line 2.
Any help would be greatly appreciated!!
Jim Minisce
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.