Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Name Validation
Alec
Hi Guys
I have the following query. it is working perfect.
the output of the Names is coming with (Last name , First Name) like (Smith, John)
is there anything I can add to the query to have the name as (John Smith).
SELECT Name, DECIMAL(SUM(Amount),8,0) as Total
FROM get_matching_rows
WHERE
Manager1 = 6651
AND QUERYDATE = DATE(SUBSTR(DIGITS( ENTERDATE), 5, 2)||'/' || SUBSTR(DIGITS( ENTERDATE), 7, 2)||'/'||SUBSTR(DIGITS( ENTERDATE), 1, 4))
GROUP BY Name
ORDER BY Total DESC
FETCH FIRST 5 ROWS ONLY
Thanks!
Find more posts tagged with
Comments
Alec
I have found the solution if someone needs it.
RTRIM(SUBSTR(M.#SLNAM,POSSTR(M.#SLNAM,',')+1)) ||' ' || RTRIM(SUBSTR(M.#SLNAM,1,POSSTR(M.#SLNAM,',')-1)) as NAME,
johnw
A computed column like:
var firstName = name.split(",")[1].trim();
var lastName = name.split(",")[0].trim();
firstName + " " + lastName
Should also work.