convert/format

  • Thread starter Thread starter Guy Cohen
  • Start date Start date
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
 
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
 
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

Back
Top