I have the following description: 'Sample Product Maker Product Name XYZ - Size' and I would like to only get the value 'Product Name XYZ' from this. If this were just one row I'd have no issue just using SUBSTRING but I have thousands of records and although the initial value Sample Product Maker is the same for all products the Product Name could be different and I don't want anything after the hyphen.What I have so far has generated the error in the header of this question. SELECT i.Itemid,RTRIM(LTRIM(SUBSTRING(i.ShortDescription, 25, (SUBSTRING(i.ShortDescription, 25, CHARINDEX('-', i.ShortDescription, 25)))))) AS ProductDescriptionAbbrev,CHARINDEX('-', i.ShortDescription, 0) - 25 as charindexposFROM titems iI am getting 'Argument data type varchar is invalid for argument 3 of substring function'As you can see, I am getting the value for the last line the sql statement but when I try and plug that into the SUBSTRING function I get various issues.
Your first call to SUBSTRING specifies a length of SUBSTRING(i.ShortDescription, 25, CHARINDEX('-', i.ShortDescription, 25)).You might try: declare @titems as Table ( ItemId Int Identity, ShortDescription VarChar(100) )insert into @titems ( ShortDescription ) values( 'Sample Product Maker Product Name XYZ - Size' )declare @SkipLength as Int = Len( 'Sample Product Maker' )select ItemId,RTrim( LTrim( Substring( ShortDescription, @SkipLength + 1, CharIndex( '-', ShortDescription, @SkipLength ) - @SkipLength - 1 ) ) ) as ProductDescriptionAbbrevfrom @titems. The problem is that your outer call to SUBSTRING is being passed a character data type from the inner SUBSTRING call in the third parameter. +-This call does not return an integer typeSELECT i.Itemid, VRTRIM(LTRIM(SUBSTRING(i.ShortDescription, 25, (SUBSTRING(i.ShortDescription, 25, CHARINDEX('-', i.ShortDescription, 25)))))) AS ProductDescriptionAbbrev,CHARINDEX('-', i.ShortDescription, 0) - 25 as charindexposFROM titems iThe third parameter must evaluate to the length that you want.
This is an acceptance test procedure for typing in a right-to-left language in the VisualEditor. The basic typing test is done using Hebrew, because Hebrew characters should be easier to discern than of the other alphabets. Special features of complex RTL scripts will be checked in other tests.
Perhaps you meant LEN(SUBSTRING(.))?
Insert a right-to-left or left-to-right markShow AllHide AllThe feature or some of the options described in this Help topic are only available if support for right-to-left languages is enabled through Microsoft Office Language Settings.Place the insertion point where you want to insert the character.On the Insert menu, click Symbol, and then click the Special Characters tab.Click Left-to-Right Mark or Right-to-Left Mark.I don't know if this helps-but maybe it's worth a try, if your problem occurs while using Word. If you don't use right-to-left languages, but for some reason they have been enabled in your language settings, disabling that might be simpler than trying to figure out how to disable the shortcut.I'm pretty low-tech so I offer this in all humility; you probably tried this weeks ago.Good luck!Jane.
On my computer, nothing happens when I press the control key with the right shift key.Some shortcuts can be changed in Word:Under 'Tools' - 'Customize'choose the tab 'Toolbars'Press the button 'Keyboard'.Here find the shortcut, that causes your problem, and change it.I hope this helps!I have a similar problem, when working with Outlook. The shortcut Control+Return sends the email without any warning. And I often use the shortcut Control+Backspace, and the backspace key is just above the return key.
But I don't think that shortcuts can be changed in Outlook.Edith ▲. Unfortunately I cannot turn off this shortcut from Word, because this is a Windows shortcut. In word it is under Format RtlPara, but there is no shortcut assigned to it. And still it works.
Maybe on your computer it doesn't work because you haven't activated the 'left-to-right' language support in Windows Regional and Language Options. But I had to do it, because otherwise I couldn't type Armenian. Although Armenian is a left-to-right language it's included in this group.Regarding Outlook, I think you're right - you cannot change the shortcuts in Outlook. But I am familiar with this problem. Here's how I have solved this problem. First of all I have unchecked the 'Send messages immediately' checkbox in Tools Options Send. So whenever a message goes to the Outbox, it is never sent to the address until I hit 'Send/Receive'.
Secondly, I usually write the address in the end, and when the 'To:' box is empty, it never goes to the Outbox, just gives an error message.Best regards,Henry ▲. I also use the trick with no address in emails before they are ready to send.I found this, it sounds very much like your problem. Perhaps it will do it:'All these settings can be changed via Control Panel Regional and Language Settings Language tab Details Key Settings'Jun 12, 2007Thank you for the link. Seems like this is really what I needed, but unfortunately it allows you to assign key sequences only for the languages, you cannot turn off the right-to-left shortcut. But I hope I can contact Microsoft through that link.Best regards,Henry. Yes, I agree, it's really strange.
In fact this was the first thing I tried when I wanted to get rid of that shortcut. Normally this type of change takes effect immediately, but I even restarted the computer, to make sure it is accepted. Nothing happened.After you suggested it, I decided to try it again, hoping that last time I had missed something, because this setting really means what I need. I did it, pressing all the 'OK's and 'Apply's, and restarted the computer. Again the shortcut didn't turn off. Then I turned off all the shortcuts, so that I wasn't even able to change the languages using the shortcut.
No luck; the text direction still changes.Thank you for all your help.Best regards,Henry ▲.