Solved

Mathematical functions in T-SQL

Posted on 2002-07-28
1
1,194 Views
Last Modified: 2011-10-03
How do I find a list of mathematical functions in SQL?

I would like to find the equivalent of the modulo function (Mod) in VB.

E.g. to look for houses with an even number, the following SQL statement works fine with Access databases:

SELECT * FROM Place WHERE (((Place.house_no) Mod 2)=0);

How do I do this in SQL Server?
0
Comment
Question by:MTecho
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
miron earned 50 total points
ID: 7184490
did you try

SELECT * FROM Place WHERE Place.house_no % 2=0;

I think sql server uses modulo operator that looks like a percent sign
---
%
---

To find complete list of mathematical functions and operators try look up On-Line documentation under
"Transact-SQL Reference->Operators"
and
"Transact-SQL Reference->Functions"


Cheers
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question