convert/format

G

Guy Cohen

Hi all
I have an integer column with currency information in cents.
How do I select x/100 correctly ? currently the result truncates the cents.

"SELECT mycolumn/100 from mytable"


Please advise
Guy
 
R

Rippo

Guy said:
Hi all
I have an integer column with currency information in cents.
How do I select x/100 correctly ? currently the result truncates the cents.

"SELECT mycolumn/100 from mytable"


Please advise
Guy

This is a SQL question in the ASP forum!


SELECT cast(mycolumn/100 as decimal(18,2)) from mytable

Look up "cast" and "datatypes" in Books Online
 
E

Eliyahu Goldin

Since sql is an essential part of web programming, it is ok to ask simple
sql questions here. When you need an expert-level advice, you have more
chances of getting it on the special group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,369
Latest member
Carmen32T6

Latest Threads

Top