SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 round
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

arkiboys
Flowing Fount of Yak Knowledge

1418 Posts

Posted - 06/17/2013 :  03:27:50  Show Profile  Reply with Quote
Hello,
There is a formula in excel as follows:
=IF(A5>0,ROUND(A5,-5)+100000,"")
I would like to do the same in sql.
For example:
The number 500000 should give 600000
The number 100000 should give the same 100000
The number 1042112 should give 1100000
The number 2301565 should give 2400000
The number 1089903 should give 1200000
The number 1362379 should give 1500000
The number 813380 should give 900000
...

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 06/17/2013 :  03:36:04  Show Profile  Reply with Quote
NULLIF(CASE WHEN Field > 0 THEN ROUND(Field,-5) + 100000 ELSE 0 END,0)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

arkiboys
Flowing Fount of Yak Knowledge

1418 Posts

Posted - 06/17/2013 :  03:50:17  Show Profile  Reply with Quote
Thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 06/17/2013 :  03:53:43  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000