Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Modulo to do about n%thing

In a notification app I wrote a few days back I needed to do a SQL calculation using modulo.  You know, divide something by something and results of zero are the ones you keep.  The SQL code I used was

select * from mytable where datediff(dd, entered_date, getdate()) % 30 = 0

I didn't know % was the SQL symbol for the mod function (and this is what I found interesting), but modulo was not listed in SQL Books Online under mathematical functions.  Now I LOVE SQL Books.  When I install SQL Server I always put a link to SQL Books Online in the top start menu for quick and frequent access.  I search SQL Books for “mod.”  Nothing.  I search “modulo” and there it is.

modulo....modulo!....MODULOOOOOO!!!

stella, is that you?

Comments (0) | Post RSS RSS comment feed

Posted on 5/7/2004 4:33:00 PM by Dave Burke
Categories:
Tags:


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke