What is the % before the substring doing?

I am using SQL Server. I ran into the follow case statement but I don't understand the syntax of the % character in the following part ...a.WMS_Shipped_Qty%substring... What is that % sign doing between the 'Qty' and the 'substring'? Thank you.

case when a.WMS_Shipped_Qty%substring(ED.casecode,patindex('[0-9]%',ED.casecode),len(ED.casecode))=0 then a.WMS_Shipped_Qty/substring(ED.casecode,patindex('%[0-9]%',ED.casecode),len(ED.casecode)) else a.WMS_Shipped_Qty end as 'WMS_Shipped_Qty' .....

more ▼

asked Jan 09 at 04:06 AM in Default

avatar image

20 1

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

It is the Modulo operator. It returns the remainder of one number divided by another.


more ▼

answered Jan 09 at 09:23 AM

avatar image

9.5k 23 59 49

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

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



Answers and Comments

SQL Server Central

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



asked: Jan 09 at 04:06 AM

Seen: 56 times

Last Updated: Jan 09 at 09:23 AM

Copyright 2017 Redgate Software. Privacy Policy