question

TrentIzzy avatar image
TrentIzzy asked

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' .....
substring
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
nidheesh.r.pillai avatar image
nidheesh.r.pillai answered
It is the Modulo operator. It returns the remainder of one number divided by another. https://msdn.microsoft.com/en-us/library/ms190279.aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.