Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if select a field with 0 we don't want to see .00

Status
Not open for further replies.

solo1234

Programmer
Jun 25, 2007
39
NL
Dear all,

We are busy with selecting a a table with data type Money and using the next statement:

SELECT CASE moneyFld WHEN 0 THEN 0 ELSE Cast(moneyFld as Numeric(10,2)) END AS moneyFld from tbl_x

Field values zero are displayed as ".00", can someone tell us how to show a real zero? ("0")

Nice regards,
Ton.
 
This is a job for your front end display (Excel, reporting software, etc.). The scale of the decimal column of your result set will be consistent across all rows, as it should be. The only way I can think of to do what you are asking is to cast the column to a char/varchar datatype and add some string manipulation logic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top