Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

 SQL Server Forums Profile | Active Topics | Members | Search | Forum FAQ
 All Forums  SQL Server 2000 Forums  SQL Server Development (2000)  decimal Reply to Topic  Printer Friendly
Author  Topic

sent_sara
Constraint Violating Yak Guru

India
377 Posts

 Posted - 12/28/2006 :  01:04:31 HI fysIam doing Earned Leave module..from jan to dec..totdays=150 (an employee worked)EL days=for 20 days 1 day pay (ie) totdays/20150/20 =7.5 eldays to be paid to an employeewhile dividing by 20 if the decimal place falls between .1 and .5 should be assigned to .5 and the result should be 7.5while dividing by 20 if the decimal place falls > .5(for example 7.7,7.8 and so on) should be assigned to 1 and the result should be 8can any one help???????

JoeNak
Constraint Violating Yak Guru

USA
292 Posts

 Posted - 12/28/2006 :  09:32:21 Check out the ROUND function....DECLARE @num decimal(10,2)DECLARE @den decimal(10,2)SET @num = 150SET @den = 20SELECT @num / @den, Round(@num / @den, 0)