x

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

TrentIzzy
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.

https://msdn.microsoft.com/en-us/library/ms190279.aspx

more ▼

answered Jan 09 at 09:23 AM

avatar image

nidheesh.r.pillai
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

By RSS:

Answers

Answers and Comments

SQL Server Central

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

Topics:

x24

asked: Jan 09 at 04:06 AM

Seen: 56 times

Last Updated: Jan 09 at 09:23 AM

Copyright 2017 Redgate Software. Privacy Policy