0

Possible Duplicate:
Remove trailing zeros from decimal in SQL Server

I have a column DECIMAL(9,6) i.e. it supports values like 999,123456.

But when I insert data like 123,4567 it becomes 123,456700

How to remove those zeros in sybase SQL?

Using this didn't work!

6
  • 1
    I allready said that those answer dodn't work.. SQL Server != Sybase SQL. Commented Mar 3, 2011 at 17:57
  • 1
    @aF: The accepted answer to that question says "...do this in the presentation layer." Is there something in your presentation layer that prevents you from being able to do this? Commented Mar 3, 2011 at 18:01
  • So, it's impossible to do it using sybase sql only? Commented Mar 3, 2011 at 18:08
  • cast to char, cut last characters. Commented Mar 3, 2011 at 18:10
  • and how can I make that automatically? sometimes has 3 decimal zeros, other times 6.. Commented Mar 3, 2011 at 18:23

1 Answer 1

1

Do it in your application/presentation layer. SQL is not the place to do cosmetic changes like dropping trailing zeroes.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.