How do I change the format of SQL output - Informix

This is a two-parter:
I have a query and I am using NVL to grab an integer but it is bringing the result back as 1.0000000000 or 2.0000000000 when it is just in the db as a 1 or a 2.

The 2nd part is I am grabbing dates as YYYY-MM-DD, I need to change the output to their preferred format of mm/dd/yyyy

Here is the query:
select i.id, e.grad_date, p.sex, a.common_app_id, i.firstname, i.lastname, i.middlename, NVL(v.score,'') as score
from id_rec i
join adm_rec a on i.id = a.id
join profile_rec p on i.id = p.id
join ed_rec e on e.id = i.id and e.prim_sch = 1
 left outer join intvwrecom_rec v on i.id = v.id and v.intvwrecom = 'INT1'
where a.plan_enr_yr = '2011'

Sample of the output I need changed:
grad_date: 2011-06-01
score: 2.0000000000000000

What I want to see:
grad_date: 06/01/2011
score: 2
dcrowley_01Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave FordSoftware Developer / Database AdministratorCommented:

add the INTEGER function to v.score and the CHAR function to grad_date with a parameter of USA.

HTH,
DaveSlash

e.g.

select i.id,
       char(e.grad_date, usa) as grad_date,
       p.sex, 
       a.common_app_id, 
       i.firstname, 
       i.lastname, 
       i.middlename, 
       NVL(integer(v.score),'') as score
  from id_rec i 
  join adm_rec a
    on i.id = a.id 
  join profile_rec p
    on i.id = p.id
  join ed_rec e
    on e.id = i.id
   and e.prim_sch = 1
  left outer join intvwrecom_rec v
    on i.id = v.id
   and v.intvwrecom = 'INT1'
 where a.plan_enr_yr = '2011'

Open in new window

dcrowley_01Author Commented:
There is no USA function in my informix, but I was able to get the date part to work like this:
 TO_CHAR(e.grad_date, "%m/%d/%iY") as grad_date

But the integer part isn't working either and I can't figure that out. It says:
Error: Routine(integer) can not be resolved
dcrowley_01Author Commented:
Answer:
select i.id, TO_CHAR(e.grad_date, "%m/%d/%iY") as grad_date, p.sex, a.common_app_id, i.firstname, i.lastname, i.middlename, TO_CHAR(NVL(v.score,''),"*") as score
from id_rec i
join adm_rec a on i.id = a.id
join profile_rec p on i.id = p.id
join ed_rec e on e.id = i.id and e.prim_sch = 1
 left outer join intvwrecom_rec v on i.id = v.id and v.intvwrecom = 'INT1'
where a.plan_enr_yr = '2011'


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dcrowley_01Author Commented:
I had to figure this out myself, but at least this gives some history if others do a search.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.