Solved

Mathematical functions in T-SQL

Posted on 2002-07-28
1
1,184 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
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now