x

[Closed] Percentage sign?

Man I'm totally boggled!

I have never seen this bit of code in my past 6 years of working with SQL Server. It seems very simple but can some one please explain to me what the "Percentage" sign between those two columns is doing? I googled but to no avail.

**SELECT @default_late_fees =
  CASE @default_days_out % @default_product_price_days_out
            <br>WHEN 0 <br>THEN (@default_days_out / @default_product_price_days_out) * @default_amount 
            <br>ELSE (FLOOR(@default_days_out / @default_product_price_days_out) + 1) * @default_amount 
       <br> END**
Thanks,
S
more ▼

asked Mar 23 '11 at 10:52 AM in Default

Slick84 gravatar image

Slick84
1.3k 75 102 142

Modulo! I guess I should have pressed F1 and clicked Arithmetic Operators first. I thought it could only be used in the LIKE statement. Boy do I feel dumb today.
Mar 23 '11 at 11:04 AM Slick84
Don't put yourself down... we all make mistakes at times. And at least you had the cojones to come back here and 'fess up!
Mar 23 '11 at 11:19 AM ThomasRushton ♦

I would like to echo Thomas. I can not tell you how many things that I have posted, to just find the answer a few min. later.

Feb 16 '12 at 06:04 PM Chris shaw
(comments are locked)
10|1200 characters needed characters left

The question has been closed Mar 23 '11 at 11:03 AM by Slick84 for the following reason:


0 answers: sort voted first

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x265

asked: Mar 23 '11 at 10:52 AM

Seen: 2220 times

Last Updated: Feb 16 '12 at 06:04 PM