How To Use Floor To ....

Apr 5, 2004

I am in a SQL class and the teacher has asked us to update a value by 100 if the id number is even using the floor function.

I am not looking for someone to write the expresion, but someone to explain how the floor function could be used to do this.

Any help would be greatly appreciated.

View 2 Replies


ADVERTISEMENT

Floor Function

Mar 9, 2004

I am trying to pull the number preceeding the decimal, but I want my output in a fixed lengh. Here is what I tried thinking it might work, however it did not.

sf_retail = right('000' + floor(cast(labsf.last_retail_price as varchar)),3),

the number I am running this against is '0000001.45' I would like my output to read '001'......I am getting only '1'

Any suggestions?

View 2 Replies View Related

Add Dollar To The Result Of Floor Value

Oct 6, 2014

I am using this query to get the nearest value and rounding it.

floor(Price*DollarPrice) as Dollars

This returns result like below

31
34
567

Now I just need to add dollar symbol before the result.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved