last four digits of a number that has different lengths.
671312Feb 3 2010 — edited Feb 4 2010I am using this but I have some emplid's that are only two numbers and it doesn't show them. I need the last four digits of the emplid, but I need to show any emplid's that have less than 4 numbers in it.
ap1.last_name || ' ' || LPAD(ap1.first_name,1) || ' ' || ap1.rate || ' ' || SUBSTR(TO_CHAR(pn.emplid),-4) AS crew_name
for example :
CREW Name EMPLID
COUTURE R AMTC 54
LUCKENBAUGH D AMT1 1701 1701
KEITHLY A AET1 9511 1099511
I need the top one to show the 54 after the rate even though it is less than 4 numbers in length.
Any ideas how to get it to show the 54 and the last four of any emplid that is more than 4 numbers in length?