Solved

Modular Division in Microsoft SQL

Posted on 2004-08-19
1
3,645 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

758 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

16 Experts available now in Live!

Get 1:1 Help Now