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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I do MOD arithmatic in 7.0? 2

Status
Not open for further replies.

Will192

Technical User
Nov 15, 2002
111
US
I have tried using the FLOOR funciton, but run into rounding problems. Is there an alternate to writing a MOD procedure?

Thanks in advance for any responses to this post.

Will Summers
 
Hi,

There is a modulus (MOD) operator in T-SQL: %

e.g.

SELECT 10 % 4

returns:

------
2

if this is what you are looking for.

Nathan

[yinyang]

 
Dear ;

You can round off using the same function in this style.

For two decimals;
FLOOR(45.5454*100)/100 it will give you 45.54

For three decimals:
FLOOR(45.5454*1000)/1000 it will give you 45.545

Regards,
Essa Mughal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top