Solved

Modular Division in Microsoft SQL

Posted on 2004-08-19
1
3,646 Views
Last Modified: 2012-08-13
I have written a query executed from VB through ADO on an Access database, that I am trying to move to Microsoft SQL Server.  The statment uses modular division in a comparison.  Access is OK with it, but SQL Server generates the following error

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'MOD'.

The statement goes something like this:

WHERE ((xSys MOD 1000) = (ySys MOD 1000))

I am trying to compare the last x digits of two numbers.

Thanks In Advance

- Michael
0
Comment
Question by:mjs082969
1 Comment
 
LVL 10

Accepted Solution

by:
AustinSeven earned 250 total points
ID: 11841402
T-SQL MOD is %

AustinSeven
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

919 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

19 Experts available now in Live!

Get 1:1 Help Now