Dmytro
Dmytro

Reputation: 5213

DB2 display number in integer form

I am doing an assignment for a course and have a table of sales which contains a field for paid_amt as double (to reduce confusion from dealing with money in cents).

The problem is that when I do a command:

select paid_amt from sales

it displays

PAID_AMT
------------------------
  +2.00000000000000E+002
  +3.33000000000000E+002

I want it to display

PAID_AMT
------------------------
200
333

instead.

How would I do this?

Thanks ahead of time!

Upvotes: 0

Views: 473

Answers (2)

M.Ali
M.Ali

Reputation: 69574

For db2

SELECT INTEGER(paid_amt)
from sales

For Sql

SELECT CAST(paid_amt AS INT)
from sales

Upvotes: 1

Sam
Sam

Reputation: 2761

You can try something like this

CAST(PAID_AMT AS INT)

Upvotes: 1

Related Questions