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.
 
Back
Top