Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Removing zero's after the decimal in a SQL View

$
0
0

Hi, I am attempting to remove the zero's after a decimal in a SQL View, basically I have a view as shown below that is pulled from multiple tables, I would like to remove the .0000 from the quantity column, however I must do this through the view due to the tables used to create the view require the .0000  

   Model                      Manufacturer      Location                   Quantity


Lenovo Tiny MP93    Lenovo             Production Floor        2.0000        

ASUS Laptop    ASUS             Front Office        1.0000




The view is used in a labeler and the labels do not have enough space to print out the .0000 at the size we would like, hence lose the .0000 and use a bigger font.

I have tried variations from different forums with no luck, but my sql statement when creating the view is here-

SELECT        dbo.inventory.item_id, dbo.item.item_number, dbo.item.description, dbo.manufacturer.name AS manufacturer, dbo.location.code, dbo.inventory.quantity, dbo.item.alt_item_number, 
                         dbo.category.description AS Category, dbo.item_type.item_type_name, dbo.item.item_type
FROM            dbo.inventory INNER JOIN
                         dbo.item ON dbo.inventory.item_id = dbo.item.item_id INNER JOIN
                         dbo.location ON dbo.inventory.location_id = dbo.location.location_id INNER JOIN
                         dbo.manufacturer ON dbo.item.manufacturer_id = dbo.manufacturer.manufacturer_id INNER JOIN
                         dbo.category ON dbo.item.category_id = dbo.category.category_id INNER JOIN
                         dbo.item_type ON dbo.item.item_type = dbo.item_type.item_type_id
WHERE        (dbo.item.item_type = 1) AND (dbo.inventory.item_id > 0)


Viewing all articles
Browse latest Browse all 7129

Trending Articles