Solved

Mathematical functions in T-SQL

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to keep a record with the highest value 3 44
Copy data to New Year 9 33
disk usage reporting tools 27 58
Converting Stored Procedure to SQL Statement 5 45
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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

696 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