Oracle to SQL

Hello,

Below is my simple query:

select *
from openquery (district,' select invoiceid,
case when custcode = 'red' then round(invoiceid/5,1) else 0 end as invoice2
from oradb
)
oradb is oracle table in oracle database

In Oracle side, I am returning decimal value but in sql I am not returning decimal value. How do I update this simple query to fix this issue so I can return the value in decimal as well?

Thank you SQL expert!

Try this:
select *
from openquery (district,' select invoiceid,
round(case when custcode = 'red' then invoiceid/5 else 0.0 end,1) as invoice2
from oradb
)

Hi bitsmed, I did try and still returning none decimal value..

How about this:
select *
from openquery (district,' select invoiceid,
round(case when custcode = 'red' then invoiceid/5.0 else 0.0 end,1) as invoice2
from oradb
)

I did that as well and still returning none decimal values as well.

select *
from openquery (district,' select invoiceid,
round(case when custcode = 'red' then cast(invoiceid as decimal(18,1))/5.0 else 0.0 end,1) as invoice2
from oradb
)

Hi bitsmed, still returning none decimal value... :frowning:

Then I'm out of ideas

please paste a few (2-3) rows of the result set from the openquery call