×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I have received a file to be used in reconciling against our orders
One of the fields (F8) is the order amount, but it is in an alpha field, left justified
For example
2,239.72
60.61
53.41
626.92
If I try and use the following
decimal(a.F8, 7, 2)
This works fine - except for the amount 2,239.72
So I came up with the following
case when length(trim(a.F8)) > 7 then
decimal(substr(trim(a.F8), 1, (length(trim(a.F8)) - 7)) concat
substr(trim(a.F8), (length(trim(a.F8)) - 5), 6), 7, 2) else
decimal(a.F8, 7, 2)
end
This will work - unless I get amount into the millions - in which case I have to expand my case
Now - here is my question
Is there a "simpler" way to do this conversion
I was somewhat surprised that
decimal(a.F8, 7, 2)
didn't handle the comma - or am I not seeing something?
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.